@import url('https://fonts.googleapis.com/css2?family=Corben:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;600;700&display=swap');

/********************************************************
 * Coach OS V2 — Single-File Design System
 * All styles are scoped to #coachos-v2-root.
 * Sections: TOKENS, RESET & UTILITIES, PRIMITIVES, COMPONENTS, THEME LIGHT
 ********************************************************/

/* ========== 1) TOKENS (Default = DARK) ========== */
#coachos-v2-root {
  /* Colors */
  --color-bg: #0f1115;
  --color-panel: #141821;
  --color-panel-subtle: #11151d;
  --color-text: #e8eaef;
  --color-muted: #9aa3b2;
  --color-primary: #3d414b;
  --color-success: #3ad07a;
  --color-warning: #f5b54a;
  --color-danger:  #ff6468;
  --color-border:  rgba(255,255,255,.09);

  /* Spacing */
  --space-1: 4px; --space-2: 8px; --space-3: 12px;
  --space-4: 16px; --space-5: 20px; --space-6: 24px; --space-8: 32px;

  /* Radius */
  --radius-sm: 6px;
  --radius-2: 8px;
  --radius-3: 12px;
  --radius-md: var(--radius-3); /* 12px */
  --radius-4: 16px;
  --radius-lg: 20px;
  --radius-2xl: 28px;
  --radius-pill: 9999px;

  /* Shadow */
  --shadow-sm: 0 4px 12px rgba(0,0,0,.22);
  --shadow-1: 0 1px 1px rgba(0,0,0,.4), 0 12px 24px rgba(0,0,0,.28);
  --shadow-2: 0 2px 2px rgba(0,0,0,.5), 0 20px 36px rgba(0,0,0,.34);

  /* Surfaces & accents */
  --surface-2: color-mix(in srgb, var(--color-panel) 88%, var(--color-primary) 12%);
  --surface-3: color-mix(in srgb, var(--color-panel) 80%, var(--color-bg) 20%);
  --accent: #7c6cff;

  /* Typography */
  --font-sans: 'Open Sans', ui-sans-serif, -apple-system, Segoe UI, Inter, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  --fs-xs: 12px; --fs-sm: 13px; --fs-md: 15px; --fs-lg: 18px; --fs-xl: 24px; --fs-hero: clamp(28px, 6vw, 36px);
  --lh: 1.45;

  /* Motion */
  --dur-1: 120ms; --dur-2: 180ms; --ease: cubic-bezier(.2,.7,.2,1);
  --header-h: 56px;
  --fs-footer-h: 80px;
  --rail-w: 280px;
  --rail-collapsed-w: 72px;
  --feed-max: 840px;
  --context-w: 360px;
  --pane-gap: clamp(12px, 2vw, 28px);
  --pane-gutter: clamp(12px, 4vw, 56px);

  /* Root element defaults */
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  min-height: 100%;
  width: 100%;
  box-sizing: border-box;
  padding: 0;
  position: fixed;
  inset: 0;
  z-index: 0;
  display: flex;
  flex-direction: column;
}

/* ===== Viewport & page lock ===== */
html.coachos-v2-lock,
body.coachos-v2-lock{
  height:100%;
  overflow:hidden;
  margin:0;
}
body.coachos-v2--lock{
  overflow:hidden;
  touch-action:none;
}

#coachos-v2-root .coachos-v2-stage{
  padding-top:var(--header-h,56px);
  height:100dvh;
  min-height:100dvh;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  width:100%;
  flex:1 1 auto;
  position:relative;
  background:linear-gradient(180deg,rgba(255,255,255,.02),transparent);
}
body.coachos-v2--fs-active #coachos-v2-root .coachos-v2-stage{
  padding-top:env(safe-area-inset-top, 0px);
}

#coachos-v2-root .coachos-v2-skip-link{
  position:absolute;
  left:-999px;
  top:auto;
  width:1px;
  height:1px;
  overflow:hidden;
  background:var(--color-panel);
  color:var(--color-text);
  padding:var(--space-3) var(--space-5);
  border-radius:var(--radius-pill);
  z-index:20;
}
#coachos-v2-root .coachos-v2-skip-link:focus{
  left:var(--pane-gutter);
  top:var(--pane-gutter);
  width:auto;
  height:auto;
  box-shadow:0 0 0 3px rgba(124,108,255,.4);
}

#coachos-v2-root [data-app-frame]{
  flex:1 1 auto;
  display:flex;
  flex-direction:column;
  gap:var(--pane-gap);
  padding:var(--pane-gutter);
  min-height:0;
}
#coachos-v2-root [data-app-frame] [data-region]{
  background:var(--color-panel);
  border-radius:var(--radius-lg);
  border:1px solid var(--color-border);
  min-height:0;
  display:none;
  overflow:hidden;
}
#coachos-v2-root [data-app-frame] [data-region="feed"]{
  display:flex;
  flex-direction:column;
  overflow-y:auto;
  background:transparent;
  border:none;
  padding:0;
  margin:0 auto;
  width:100%;
  max-width:var(--feed-max);
}
#coachos-v2-root [data-app-frame] [data-region="feed"]{
  position:relative;
}
#coachos-v2-root [data-feed-skeleton]{
  display:none;
  flex-direction:column;
  gap:var(--space-3);
  margin-bottom:var(--space-4);
}
#coachos-v2-root [data-feed-skeleton].is-visible{
  display:flex;
}
#coachos-v2-root [data-feed-content]{
  flex:1 1 auto;
  min-height:0;
}
#coachos-v2-root [data-app-frame] [data-region="rail"],
#coachos-v2-root [data-app-frame] [data-region="context"]{
  padding:0;
}

#coachos-v2-root [data-region="rail"] .coachos-v2-rail,
#coachos-v2-root [data-region="context"] .coachos-v2-context-shell{
  height:100%;
}

#coachos-v2-root [data-region="context"]{
  display:flex;
}

#coachos-v2-root [data-region="rail"]{
  display:none;
}

@media (min-width: 769px){
  #coachos-v2-root [data-app-frame]{
    display:grid;
    grid-template-columns:var(--rail-collapsed-w) minmax(0,1fr);
    align-items:stretch;
  }
  #coachos-v2-root [data-region="rail"]{
    display:block;
  }
  #coachos-v2-root [data-app-frame] [data-region="feed"]{
    grid-column:2 / span 1;
    max-width:100%;
    padding:0;
  }
  #coachos-v2-root [data-region="context"]{
    position:absolute;
    right:var(--pane-gutter);
    top:var(--pane-gutter);
    bottom:var(--pane-gutter);
    width:var(--context-w);
    max-width:calc(100% - var(--rail-collapsed-w) - var(--pane-gap));
    box-shadow:var(--shadow-2);
    transform:translateX(120%);
    transition:transform var(--dur-2) var(--ease);
    display:flex;
    pointer-events:none;
    z-index:20;
  }
  #coachos-v2-root .coachos-v2-stage[data-context-open="true"] [data-region="context"]{
    transform:translateX(0);
    pointer-events:auto;
  }
}

@media (min-width: 1200px){
  #coachos-v2-root [data-app-frame]{
    grid-template-columns:var(--rail-w) minmax(0,var(--feed-max)) var(--context-w);
  }
  #coachos-v2-root [data-region="context"]{
    position:static;
    transform:none !important;
    box-shadow:none;
    display:block;
  }
}

@media (max-width: 768px){
  #coachos-v2-root [data-region="rail"],
  #coachos-v2-root [data-region="context"]{
    display:none !important;
  }
  #coachos-v2-root [data-app-frame]{
    padding:0;
    gap:0;
  }
  #coachos-v2-root [data-app-frame] [data-region]{
    border-radius:0;
    border:none;
  }
}

@media (prefers-reduced-motion: reduce){
  #coachos-v2-root [data-region="context"]{
    transition:none;
  }
}

#coachos-v2-root .coachos-v2-rail{
  width:var(--rail-w);
  padding:var(--space-5);
  display:flex;
  flex-direction:column;
  gap:var(--space-5);
  height:100%;
}
#coachos-v2-root .coachos-v2-rail[data-collapsed="true"]{
  width:var(--rail-collapsed-w);
  padding:var(--space-4) var(--space-3);
}
#coachos-v2-root .coachos-v2-rail__inner{
  display:flex;
  flex-direction:column;
  gap:var(--space-5);
  height:100%;
}
#coachos-v2-root .coachos-v2-rail__profile{
  display:flex;
  align-items:center;
  gap:var(--space-3);
  padding:var(--space-3);
  border-radius:var(--radius-lg);
  background:var(--surface-2);
  border:1px solid rgba(255,255,255,.05);
  box-shadow:var(--shadow-sm);
}
#coachos-v2-root .coachos-v2-rail__avatar{
  width:48px;
  height:48px;
  border-radius:50%;
  background:linear-gradient(135deg,rgba(255,255,255,.12),rgba(255,255,255,.02));
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:600;
  color:var(--color-text);
  position:relative;
  overflow:hidden;
}
#coachos-v2-root .coachos-v2-rail__avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
#coachos-v2-root .coachos-v2-rail__identity{
  flex:1;
  min-width:0;
}
#coachos-v2-root .coachos-v2-rail__label{
  font-size:var(--fs-md);
  margin:0;
  font-weight:600;
}
#coachos-v2-root .coachos-v2-rail__status{
  margin:0;
  color:var(--color-muted);
  font-size:var(--fs-sm);
}
#coachos-v2-root .coachos-v2-rail__chip{
  padding:2px 10px;
  border-radius:var(--radius-pill);
  font-size:var(--fs-xs);
}
#coachos-v2-root .coachos-v2-rail__nav ul{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:4px;
}
#coachos-v2-root .coachos-v2-rail__link{
  width:100%;
  border:none;
  background:transparent;
  color:inherit;
  display:flex;
  align-items:center;
  gap:var(--space-3);
  font-size:var(--fs-md);
  font-weight:500;
  padding:var(--space-3);
  border-radius:var(--radius-lg);
  cursor:pointer;
  transition:background var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
}
#coachos-v2-root .coachos-v2-rail__link:hover,
#coachos-v2-root .coachos-v2-rail__link:focus-visible{
  background:rgba(255,255,255,.08);
}
#coachos-v2-root .coachos-v2-rail__link.is-active{
  background:rgba(124,108,255,.15);
  color:#fff;
}
#coachos-v2-root .coachos-v2-rail__icon{
  width:40px;
  height:40px;
  border-radius:50%;
  background:rgba(255,255,255,.06);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:18px;
}
#coachos-v2-root .coachos-v2-rail__badge{
  margin-left:auto;
  font-size:var(--fs-xs);
}
#coachos-v2-root .coachos-v2-rail__utility{
  margin-top:auto;
  display:flex;
  flex-direction:column;
  gap:var(--space-2);
}
#coachos-v2-root .coachos-v2-rail__utility-btn{
  border:none;
  background:rgba(255,255,255,.04);
  color:inherit;
  padding:var(--space-2) var(--space-3);
  border-radius:var(--radius-md);
  display:flex;
  align-items:center;
  gap:var(--space-2);
  cursor:pointer;
  font-size:var(--fs-sm);
}
#coachos-v2-root .coachos-v2-rail__utility-btn:hover,
#coachos-v2-root .coachos-v2-rail__utility-btn:focus-visible{
  background:rgba(255,255,255,.08);
}

#coachos-v2-root .coachos-v2-rail[data-collapsed="true"] .coachos-v2-rail__text,
#coachos-v2-root .coachos-v2-rail[data-collapsed="true"] .coachos-v2-rail__identity,
#coachos-v2-root .coachos-v2-rail[data-collapsed="true"] [data-streak-chip],
#coachos-v2-root .coachos-v2-rail[data-collapsed="true"] .coachos-v2-rail__utility{
  opacity:0;
  pointer-events:none;
  position:absolute;
  clip:rect(0 0 0 0);
}

#coachos-v2-root .coachos-v2-context-shell{
  background:var(--color-panel);
  border-radius:var(--radius-lg);
  border:1px solid var(--color-border);
  display:flex;
  flex-direction:column;
  height:100%;
  padding:var(--space-4);
  gap:var(--space-4);
}
#coachos-v2-root .coachos-v2-context-shell__header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:var(--space-3);
}
#coachos-v2-root .coachos-v2-context-shell__eyebrow{
  text-transform:uppercase;
  letter-spacing:.08em;
  font-size:var(--fs-xs);
  margin:0;
  color:var(--color-muted);
}
#coachos-v2-root .coachos-v2-context-shell__title{
  margin:0;
  font-size:var(--fs-lg);
}
#coachos-v2-root .coachos-v2-context-close{
  border:none;
  background:rgba(255,255,255,.08);
  width:32px;
  height:32px;
  border-radius:50%;
  color:var(--color-text);
  cursor:pointer;
}
#coachos-v2-root .coachos-v2-context-close:hover,
#coachos-v2-root .coachos-v2-context-close:focus-visible{
  background:rgba(255,255,255,.2);
}
#coachos-v2-root .coachos-v2-context-shell__body{
  flex:1 1 auto;
  overflow:auto;
  display:flex;
  flex-direction:column;
  gap:var(--space-4);
}
#coachos-v2-root .coachos-v2-context-section{
  display:flex;
  flex-direction:column;
  gap:var(--space-2);
  padding-bottom:var(--space-2);
  border-bottom:1px solid rgba(255,255,255,.05);
}
#coachos-v2-root .coachos-v2-context-section header p{
  margin:0;
  font-size:var(--fs-sm);
  color:var(--color-muted);
  letter-spacing:.04em;
  text-transform:uppercase;
}
#coachos-v2-root .coachos-v2-context-section ul{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:var(--space-2);
}
#coachos-v2-root .coachos-v2-context-row{
  display:flex;
  gap:var(--space-3);
  align-items:flex-start;
}
#coachos-v2-root .coachos-v2-context-row--roster{
  align-items:center;
}
#coachos-v2-root .coachos-v2-context-avatar,
#coachos-v2-root .coachos-v2-context-icon{
  width:32px;
  height:32px;
  border-radius:50%;
  background:rgba(255,255,255,.08);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:var(--fs-sm);
}
#coachos-v2-root .coachos-v2-context-meta{
  margin:0;
  color:var(--color-muted);
  font-size:var(--fs-xs);
}
#coachos-v2-root .coachos-v2-context-link{
  color:var(--color-text);
  text-decoration:none;
  padding:var(--space-2) 0;
  border-bottom:1px dashed rgba(255,255,255,.2);
}
#coachos-v2-root .coachos-v2-context-link:hover,
#coachos-v2-root .coachos-v2-context-link:focus-visible{
  color:#fff;
  border-bottom-color:rgba(255,255,255,.6);
}
#coachos-v2-root .coachos-v2-context-card{
  background:rgba(255,255,255,.04);
  border-radius:var(--radius-md);
  padding:var(--space-3);
  display:flex;
  flex-direction:column;
  gap:var(--space-2);
}
#coachos-v2-root .coachos-v2-context-outline{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:var(--space-2);
}
#coachos-v2-root .coachos-v2-context-outline__item{
  display:flex;
  gap:var(--space-3);
  padding:var(--space-2);
  border-radius:var(--radius-md);
  background:rgba(255,255,255,.02);
  align-items:flex-start;
}
#coachos-v2-root .coachos-v2-context-outline__item.is-current{
  border:1px solid rgba(124,108,255,.6);
  background:rgba(124,108,255,.08);
}
#coachos-v2-root .coachos-v2-context-outline__item.is-locked{
  opacity:.6;
}
#coachos-v2-root .coachos-v2-context-outline__bullet{
  font-weight:600;
  font-size:var(--fs-sm);
  width:32px;
  text-align:center;
}
#coachos-v2-root .coachos-v2-context-outline__meta{
  flex:1;
  display:flex;
  flex-direction:column;
  gap:2px;
}
#coachos-v2-root .coachos-v2-context-outline__title{
  margin:0;
  font-weight:600;
}
#coachos-v2-root .coachos-v2-context-outline__status{
  font-size:var(--fs-xs);
  color:var(--color-muted);
}
#coachos-v2-root .coachos-v2-context-cta{
  border:1px solid rgba(255,255,255,.2);
  background:transparent;
  color:inherit;
  padding:var(--space-2) var(--space-4);
  border-radius:var(--radius-pill);
  cursor:pointer;
  font-size:var(--fs-sm);
}
#coachos-v2-root .coachos-v2-context-actions{
  display:flex;
  flex-wrap:wrap;
  gap:var(--space-2);
}
#coachos-v2-root .coachos-v2-context-empty{
  color:var(--color-muted);
  margin:0;
}
#coachos-v2-root .coachos-v2-context-notes__input{
  width:100%;
  border:1px solid rgba(255,255,255,.15);
  border-radius:var(--radius-md);
  background:rgba(255,255,255,.03);
  color:var(--color-text);
  padding:var(--space-3);
  resize:vertical;
}
#coachos-v2-root .coachos-v2-context-notes__input:focus{
  outline:2px solid rgba(124,108,255,.6);
  outline-offset:2px;
}
#coachos-v2-root .coachos-v2-context-row--roster .coachos-v2-context-meta{
  margin:0;
}
#coachos-v2-root .coachos-v2-presence{
  width:12px;
  height:12px;
  border-radius:50%;
  background:rgba(255,255,255,.2);
  box-shadow:0 0 0 2px rgba(20,24,33,.8);
  margin-top:6px;
}
#coachos-v2-root .coachos-v2-presence--online{ background:#3ad07a; }
#coachos-v2-root .coachos-v2-presence--away{ background:#f5b54a; }
#coachos-v2-root .coachos-v2-presence--busy{ background:#ff6468; }
#coachos-v2-root .coachos-v2-presence--offline{ background:rgba(255,255,255,.2); }

#coachos-v2-root .coachos-v2-context-overlay{
  position:absolute;
  inset:var(--pane-gutter);
  border:none;
  background:rgba(8,10,15,.6);
  backdrop-filter:blur(4px);
  padding:0;
  margin:0;
  opacity:0;
  pointer-events:none;
  transition:opacity var(--dur-2) var(--ease);
  z-index:15;
}
#coachos-v2-root .coachos-v2-context-overlay.is-visible{
  opacity:1;
  pointer-events:auto;
}
@media (max-width: 768px){
  #coachos-v2-root .coachos-v2-context-overlay{
    display:none !important;
  }
}
@media (min-width: 1200px){
  #coachos-v2-root .coachos-v2-context-overlay{
    display:none !important;
  }
}

#coachos-v2-root .coachos-v2-skeleton-card{
  border-radius:var(--radius-lg);
  background:linear-gradient(90deg,rgba(255,255,255,.04) 25%,rgba(255,255,255,.08) 37%,rgba(255,255,255,.04) 63%);
  background-size:400% 100%;
  height:140px;
  animation:coachos-v2-shimmer 1.6s infinite;
}

@keyframes coachos-v2-shimmer{
  0%{background-position:200% 0;}
  100%{background-position:-200% 0;}
}

@media (prefers-reduced-motion: reduce){
  #coachos-v2-root .coachos-v2-skeleton-card{
    animation:none;
  }
}



/* Tokens for fullscreen density */
:root #coachos-v2-root{
  --fs-header-h:56px;
  --fs-footer-h:80px;
  --fs-gap:var(--space-4);
}

/* ===== Skeleton primitives ===== */
:root{
  --coachos-v2-skel-bg-from: rgba(255,255,255,0.06);
  --coachos-v2-skel-bg-mid:  rgba(255,255,255,0.16);
  --coachos-v2-skel-radius: 999px;
  --coachos-v2-skel-height: 0.875rem; /* ~14px */
  --coachos-v2-skel-speed: 1.4s;
}

#coachos-v2-root .coachos-v2-skel{
  display:block;
  height:var(--coachos-v2-skel-height);
  border-radius:var(--coachos-v2-skel-radius);
  background:linear-gradient(
    90deg,
    var(--coachos-v2-skel-bg-from) 0%,
    var(--coachos-v2-skel-bg-mid) 50%,
    var(--coachos-v2-skel-bg-from) 100%
  );
  background-size:200% 100%;
  animation:coachos-v2-shimmer var(--coachos-v2-skel-speed) ease infinite;
}

#coachos-v2-root .coachos-v2-skel--chip{
  width:5rem; /* ~80px */
  height:1.25rem;
  margin-bottom:0.75rem;
}

#coachos-v2-root .coachos-v2-skel--title{
  width:60%;
  height:1.5rem;
  margin-bottom:0.5rem;
}

#coachos-v2-root .coachos-v2-skel--line{
  width:90%;
  margin-bottom:0.5rem;
}

#coachos-v2-root .coachos-v2-skel--line-short{
  width:50%;
}

#coachos-v2-root .coachos-v2-skel--cta{
  width:8.75rem;  /* ~140px */
  height:2.375rem;
  border-radius:var(--coachos-v2-skel-radius);
  margin-top:1rem;
}

#coachos-v2-root .coachos-v2-skel--avatar{
  width:3rem;
  height:3rem;
  border-radius:999px;
}

#coachos-v2-root .coachos-v2-skeleton-wrap{
  opacity:0;
}

/* View-level fade */
#coachos-v2-root .coachos-v2-view{
  opacity:1;
  transform:translateY(0);
  transition:opacity 180ms ease-out, transform 180ms ease-out;
}

#coachos-v2-root .coachos-v2-view--loading{
  opacity:0.6;
  transform:translateY(4px);
}

#coachos-v2-root .coachos-v2-view--hidden{
  opacity:0;
  pointer-events:none;
}


/* ===== Route variants ===== */
#coachos-v2-root .coachos-v2-route,
#coachos-v2-root .coachos-v2-route-full{
  flex:1 1 auto;
  display:flex;
  flex-direction:column;
  min-height:0;
  width:100%;
}

/* Route container: no side padding, top/bottom rhythm only */
#coachos-v2-root .coachos-v2-route--padded{
  flex:1 1 auto;
  display:flex;
  flex-direction:column;
  min-height:0;
  width:100%;
  padding-top:var(--space-5);
  padding-bottom:var(--space-5);
  padding-left:0;
  padding-right:0;
  gap:var(--space-4);
}
#coachos-v2-root .cohort-detail.coachos-v2-route--padded{
  padding-top:0;
}

#coachos-v2-root .coachos-v2-route--chat{
  flex:1 1 auto;
  display:flex;
  flex-direction:column;
  min-height:0;
  width:100%;
  border:none !important;
  background-color:transparent !important;
}

#coachos-v2-root .coachos-v2-route--padded .coachos-v2-card{
  border-radius:var(--radius-4);
  box-shadow:var(--shadow-1);
  border:1px solid var(--color-border);
}

#coachos-v2-root .coachos-v2-route--chat .coachos-v2-card{
  border-radius:0;
  box-shadow:none;
  border:none;
}
#coachos-v2-root .coachos-v2-route--chat .coachos-v2-card:hover{
  box-shadow:none;
  transform:none;
}

#coachos-v2-root .coachos-v2-route--chat .coachos-v2-dm-thread,
#coachos-v2-root .coachos-v2-route--chat .coachos-v2-dm-thread__list{
  flex:1 1 auto;
  display:flex;
  flex-direction:column;
}
#coachos-v2-root .coachos-v2-route--chat .coachos-v2-dm-thread__list{
  overflow:auto;
  padding:var(--space-4) var(--space-4) var(--space-6);
  gap:.75rem;
}
#coachos-v2-root .coachos-v2-route--chat .coachos-v2-dm-composer{
  position:sticky;
  bottom:0;
  z-index:10;
  background:var(--color-panel);
  border-top:1px solid var(--color-border);
  padding:var(--space-3) var(--space-4);
}

#coachos-v2-root .coachos-v2-scroll{
  flex:1 1 auto;
  overflow:auto;
}

@media (min-width: 640px){
  #coachos-v2-root{
    --header-h:64px;
  }
}

/* ========== 2) RESET & UTILITIES (scoped) ========== */
#coachos-v2-root * { box-sizing: border-box; }
#coachos-v2-root h1,#coachos-v2-root h2,#coachos-v2-root h3 { margin: 0; }
#coachos-v2-root a { color: inherit; text-decoration: none; }
#coachos-v2-root .coachos-v2-link{
  color:var(--color-primary);
  text-decoration:underline;
  text-decoration-thickness:2px;
  text-underline-offset:2px;
  font-weight:600;
}
#coachos-v2-root .coachos-v2-link:hover,
#coachos-v2-root .coachos-v2-link:focus{
  color:color-mix(in oklab, var(--color-primary) 80%, #ffffff 20%);
}
#coachos-v2-root .coachos-v2-link:focus-visible{
  outline:2px solid color-mix(in oklab, var(--color-primary) 70%, #ffffff 30%);
  outline-offset:2px;
}
#coachos-v2-root .u-flex{display:flex}
#coachos-v2-root .u-items-center{align-items:center}
#coachos-v2-root .u-justify-between{justify-content:space-between}
#coachos-v2-root .u-gap-2{gap:var(--space-2)}
#coachos-v2-root .u-gap-3{gap:var(--space-3)}
#coachos-v2-root .u-mt-3{margin-top:var(--space-3)}
#coachos-v2-root .u-mt-4{margin-top:var(--space-4)}
#coachos-v2-root .u-avatar-80{width:80px;height:80px;border-radius:var(--radius-pill);object-fit:cover;display:block}
#coachos-v2-root .u-stack-lg{display:flex;flex-direction:column;gap:var(--space-6)}
#coachos-v2-root .u-stack-md>*+*{margin-top:var(--space-4)}
#coachos-v2-root .u-stack-sm>*+*{margin-top:var(--space-3)}
#coachos-v2-root .u-hide-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;clip-path:inset(50%)}

/* Community modules tab helper */
#coachos-v2-root [data-cohort-tab="modules"]{
  display:flex;
  flex-direction:column;
  gap:var(--space-5);
}
#coachos-v2-root [data-cohort-tab="modules"] [data-cohort-modules-list]{
  display:flex;
  flex-direction:column;
  gap:0;
}
#coachos-v2-root [data-cohort-tab="modules"] .coachos-v2-card{
  margin-left:0;
  margin-right:0;
}
#coachos-v2-root .module-card{
  cursor:pointer;
}
#coachos-v2-root .module-card:focus-visible{
  outline:2px solid color-mix(in oklab, var(--color-primary) 65%, #000 10%);
  outline-offset:4px;
}
#coachos-v2-root .module-card__header{
  display:flex;
  flex-wrap:wrap;
  align-items:flex-start;
  justify-content:space-between;
  gap:var(--space-3);
}
#coachos-v2-root .module-card__title{
  flex:1 1 auto;
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:var(--space-2);
}
#coachos-v2-root .module-card__title h4{
  margin:0;
}
#coachos-v2-root .module-card__chip{
  flex:0 0 auto;
  white-space:nowrap;
  border:1px solid var(--color-border);
  background:var(--color-panel);
  color:var(--color-text);
}
#coachos-v2-root .module-card__chip.chip--ok{
  color:var(--color-success);
  background:color-mix(in oklab, var(--color-panel) 90%, var(--color-success) 10%);
}
#coachos-v2-root .module-card__meta{
  margin:0;
}
#coachos-v2-root .module-card__desc{
  margin:0;
}
#coachos-v2-root .module-card__progress{
  width:100%;
  height:4px;
  border-radius:999px;
  background:color-mix(in oklab, var(--color-panel-subtle) 85%, transparent 15%);
  overflow:hidden;
}
#coachos-v2-root .module-card__progress-fill{
  display:block;
  height:100%;
  border-radius:inherit;
  background:var(--color-primary);
  transition:width var(--dur-2) var(--ease);
}
#coachos-v2-root .overview-gamification__chips{
  display:flex;
  flex-wrap:wrap;
  gap:var(--space-2);
  margin-bottom:var(--space-3);
}

/* ========== 3) PRIMITIVES (global building blocks) ========== */

/* Card */
/* Default card gutters now live on the card itself */
#coachos-v2-root .coachos-v2-card{
  margin-left:var(--space-5);
  margin-right:var(--space-5);
  background:var(--color-panel);
  border:1px solid var(--color-border);
  border-radius:var(--radius-4);
  box-shadow:var(--shadow-1);
  padding:var(--space-5);
  transition:box-shadow var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
}

/* Remove horizontal margins for compact stacked cards */
#coachos-v2-root .coachos-v2-card.u-stack-xs{
  margin-left:0;
  margin-right:0;
}
#coachos-v2-root .coachos-v2-card:hover{ box-shadow:var(--shadow-2); transform: translateY(-1px); }

/* Journal list: main card should not hover/lift */
#coachos-v2-root [data-journal-history].coachos-v2-card{
  transition:none;
}
#coachos-v2-root [data-journal-history].coachos-v2-card:hover{
  box-shadow:none;
  transform:none;
}

/* Card loading / loaded helpers */
#coachos-v2-root .coachos-v2-card--loading .coachos-v2-card__content{
  opacity:0;
}

#coachos-v2-root .coachos-v2-card--loading .overview-card__header{
  opacity:0;
}

#coachos-v2-root .coachos-v2-card--loading .overview-card__body > :not(.coachos-v2-skeleton-wrap),
#coachos-v2-root .coachos-v2-card--loading .overview-card__footer{
  opacity:0;
}

#coachos-v2-root .coachos-v2-card--loading .coachos-v2-skeleton-wrap{
  opacity:1;
}

#coachos-v2-root .coachos-v2-card--loaded .coachos-v2-skeleton-wrap{
  opacity:0;
}

#coachos-v2-root .coachos-v2-card--loaded .coachos-v2-card__content{
  opacity:1;
  transition:opacity 150ms ease-out;
}

#coachos-v2-root .coachos-v2-card--loading .program-step-card__layout > :not(.coachos-v2-skeleton-wrap){
  opacity:0;
}
#coachos-v2-root .coachos-v2-card.card--frameless{
  background:transparent;
  border:0;
  box-shadow:none;
  padding:0;
}
#coachos-v2-root .coachos-v2-card.card--frameless .card__header{
  padding:0 var(--space-2) var(--space-2);
}
#coachos-v2-root .coachos-v2-card.card--frameless .card__content{
  padding:0 var(--space-2) var(--space-2);
}

/* Full-width variant for edge-to-edge hero or strip sections */
#coachos-v2-root .coachos-v2-card.card--fullwidth{
  margin-left:0;
  margin-right:0;
  border-radius:0; /* optional, removes corner rounding when bleeding */
}

/* Per-card shorthand: makes a card feel like part of the fullscreen canvas */
#coachos-v2-root .coachos-v2-card.card--canvas{
  margin-left:0;
  margin-right:0;
  background:transparent;
  border:0;
  box-shadow:none;
  border-radius:0;
}

/* Journal list: main card should be unpadded */
#coachos-v2-root .coachos-v2-journal.card--canvas{
  padding:0;
}

/* Context: when a fullscreen route wants a canvas feel for its content */
#coachos-v2-root .fs-route .coachos-v2-card:not(.coachos-v2-card--fs){
  margin-left:0;
  margin-right:0;
  background:transparent;
  border:0;
  box-shadow:none;
  border-radius:0;
}

/* Escape hatch: surfaced card inside a canvas screen */
#coachos-v2-root .coachos-v2-card.card--surface{
  background:var(--color-panel);
  border:1px solid var(--color-border);
  box-shadow:var(--shadow-1);
  border-radius:var(--radius-4);
  margin-left:var(--gutter-x, var(--space-5));
  margin-right:var(--gutter-x, var(--space-5));
}
#coachos-v2-root .coachos-v2-card[data-hero]{
  background:transparent;
  border:0;
  padding:10px;
  box-shadow:none;
}
#coachos-v2-root [data-decision] .btn--sm,
#coachos-v2-root [data-decision] .co-btn--primary{
  border-radius:var(--radius-pill);
}
#coachos-v2-root [data-decision] .co-btn--primary{
  background:var(--color-primary);
  color:#ffffff;
  border-color:transparent;
  box-shadow:none;
}
#coachos-v2-root .coachos-v2-header.header--lg{
  font-size:var(--fs-lg);
  line-height:1.2;
  font-weight:600;
}
#coachos-v2-root .coachos-v2-card--quote{
  position:relative;
  overflow:hidden;
  padding:0;
  min-height:350px;
  display:flex;
  align-items:stretch;
  background:var(--surface-3, #171b25);
  color:var(--color-text, #fff);
}
#coachos-v2-root .coachos-v2-card--quote .quote-card__bg{
  position:absolute;
  inset:0;
  background:linear-gradient(135deg, rgba(37,42,60,.9), rgba(14,16,24,.95));
  background-size:cover;
  background-position:center;
  transition:filter var(--dur-2) var(--ease), transform var(--dur-2) var(--ease), opacity var(--dur-2) var(--ease);
}
#coachos-v2-root .coachos-v2-card--quote .quote-card__bg.has-image{
  filter:brightness(.85) saturate(1.05);
}
#coachos-v2-root .coachos-v2-card--quote .quote-card__overlay{
  position:absolute;
  inset:0;
  background:linear-gradient(180deg, rgba(5,6,9,.2) 0%, rgba(5,6,9,.85) 100%);
}
#coachos-v2-root .coachos-v2-card--quote .quote-card__content{
  position:relative;
  z-index:1;
  padding:var(--space-6);
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  gap:var(--space-3);
  min-height:200px;
  color:var(--color-text, #fff);
  text-shadow:0 6px 24px rgba(0,0,0,.55);
}
#coachos-v2-root .coachos-v2-card--quote .quote-card__icon{
  font-size:2.5rem;
  line-height:1;
  opacity:.4;
}
#coachos-v2-root .coachos-v2-card--quote .quote-card__text{
  font-size:25px;
  line-height:1.4;
  font-weight:500;
  font-family:'Corben', var(--font-sans);
}
#coachos-v2-root .coachos-v2-card--quote .quote-card__author{
  font-size:var(--fs-md);
  opacity:.85;
}
#coachos-v2-root .coachos-v2-card--quote .quote-card__author.is-hidden{
  display:none;
}
#coachos-v2-root .coachos-v2-card--quote .quote-card__skeleton{
  position:relative;
  z-index:1;
  padding:var(--space-6);
  width:100%;
  display:none;
  flex-direction:column;
  gap:var(--space-3);
}
#coachos-v2-root .coachos-v2-card--quote .quote-card__skeleton-line{
  height:12px;
  border-radius:var(--radius-pill);
  background:linear-gradient(90deg, rgba(255,255,255,.14), rgba(255,255,255,.04), rgba(255,255,255,.14));
  background-size:200% 100%;
  animation:quote-card-shimmer 1.6s linear infinite;
  opacity:.75;
}
#coachos-v2-root .coachos-v2-card--quote .quote-card__skeleton-line--lg{
  width:80%;
  height:16px;
}
#coachos-v2-root .coachos-v2-card--quote .quote-card__skeleton-line--md{
  width:55%;
}
#coachos-v2-root .coachos-v2-card--quote.is-loading .quote-card__content{
  opacity:0;
}
#coachos-v2-root .coachos-v2-card--quote.is-loading .quote-card__skeleton{
  display:flex;
}
#coachos-v2-root .coachos-v2-card--quote.is-fallback .quote-card__bg{
  filter:grayscale(.35);
}
#coachos-v2-root .coachos-v2-card--quote.is-fallback .quote-card__overlay{
  background:linear-gradient(180deg, rgba(8,9,12,.85), rgba(8,9,12,.95));
}

@keyframes quote-card-shimmer{
  0%{ background-position:200% 0; }
  100%{ background-position:-200% 0; }
}

/* === v2 Card: fullscreen variant ==========================================
   Cards placed INSIDE an fs-route (fullscreen) use this modifier so they
   inherit the same tokens but reset any transforms/offsets the canvas applies.
   ------------------------------------------------------------------------ */
#coachos-v2-root .fs-route .coachos-v2-card--fs{
  background:var(--surface-2, #12151b);
  color:var(--text-1, #e8ecf5);
  border:1px solid var(--surface-3, rgba(255,255,255,0.08));
  border-radius:var(--radius-xl, 16px);
  box-shadow:var(--shadow-md, 0 8px 32px rgba(0,0,0,0.35));
  padding:var(--space-6, 24px);
  max-width:720px;
  margin:0;
  transform:none;
  will-change:auto;
}

#coachos-v2-root .fs-route .coachos-v2-card--fs .coachos-v2-header{
  margin-bottom:var(--space-4);
}

#coachos-v2-root .fs-route .coachos-v2-card--fs .coachos-v2-actions{
  display:flex;
  gap:var(--space-3);
  flex-wrap:wrap;
}

@media (max-width: 640px){
  #coachos-v2-root .fs-route .coachos-v2-card--fs{
    max-width:none;
    margin:0;
    padding:var(--space-5);
  }
}

/* Utility for non-card blocks that should stretch full width */
#coachos-v2-root .u-fullwidth{
  margin-left:0 !important;
  margin-right:0 !important;
}

/* Header text */
#coachos-v2-root .coachos-v2-header{ font-size:var(--fs-xl); font-weight:700; margin:0 0 var(--space-4); }
#coachos-v2-root .header--hero{ font-size:var(--fs-hero); font-weight:800; }
#coachos-v2-root .header--sm{ font-size:var(--fs-lg); }

/* Body / content text */
#coachos-v2-root .coachos-v2-content{ font-size:var(--fs-md); color:var(--color-text); }
#coachos-v2-root .content--muted{ color:var(--color-muted);font-size: var(--fs-sm);}
#coachos-v2-root .content--label{ font-size:var(--fs-xs); letter-spacing:.08em; text-transform:uppercase; color:var(--color-muted); }

/* Button */
#coachos-v2-root .coachos-v2-button{
  display:inline-flex; align-items:center; justify-content:center; gap:var(--space-2);
  padding:10px 14px; border-radius:var(--radius-pill);
  border:1px solid var(--color-border);
  background:var(--color-panel-subtle); color:var(--color-text);
  cursor:pointer; transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
#coachos-v2-root .coachos-v2-button--primary{ background:var(--color-primary); color:#ffffff; border-color:transparent; }
#coachos-v2-root .coachos-v2-button--ghost{ background:transparent; }
#coachos-v2-root .coachos-v2-button:disabled{ opacity:.6; cursor:not-allowed; }
#coachos-v2-root .coachos-v2-button:focus-visible{ outline:2px solid color-mix(in oklab,var(--color-primary) 50%, black 10%); outline-offset:2px; }
#coachos-v2-root .btn--sm{ padding:6px 10px; font-size:var(--fs-sm); }
#coachos-v2-root .btn--lg{ padding:12px 16px; font-size:var(--fs-lg); }

/* Chip / pill */
#coachos-v2-root .coachos-v2-chip{
  display:inline-flex; align-items:center; gap:6px; padding:4px 10px;
  border-radius:var(--radius-pill); font-size:var(--fs-xs); color:var(--color-muted);
  background: color-mix(in srgb, #0b0c10 70%, var(--color-panel-subtle) 30%);
}
#coachos-v2-root .program-step-card__chip{
  background: rgba(255,255,255,0.08);
}
#coachos-v2-root .program-step-card__label{
  margin-top:10px;
  margin-bottom:-2px;
}
#coachos-v2-root .program-step-card .card__title{
  line-height:1.3em;
  margin-bottom:0;
}
#coachos-v2-root .chip--ok{ color:var(--color-success); background: color-mix(in oklab, var(--color-success) 16%, var(--color-panel) 84%); }
#coachos-v2-root .chip--warn{ color:var(--color-warning); background: color-mix(in oklab, var(--color-warning) 16%, var(--color-panel) 84%); }
#coachos-v2-root .chip--danger{ color:var(--color-danger); background: color-mix(in oklab, var(--color-danger) 16%, var(--color-panel) 84%); }

/* Input / textarea */
#coachos-v2-root .coachos-v2-input{
  width:100%; padding:12px 14px; border-radius:var(--radius-3);
  border:1px solid var(--color-border); background:var(--color-panel-subtle); color:var(--color-text);
}
#coachos-v2-root .coachos-v2-input:focus-visible{
  outline:2px solid color-mix(in oklab, var(--color-primary) 45%, black 10%);
  outline-offset:2px;
}

/* List row */
#coachos-v2-root :is(.coachos-v2-row,.coachos-v2-journal-row){
  display:flex; align-items:center; gap:var(--space-4); padding:var(--space-5);
  background:var(--color-panel-subtle); border:1px solid var(--color-border); border-radius:var(--radius-4);
}

#coachos-v2-root .program-step-card__layout{
  display:flex; align-items:center; gap:var(--space-3);
}
#coachos-v2-root .program-step-card__duration{
  display:flex; align-items:center; gap:var(--space-2);
  padding:0; background:transparent; border:0;
}
#coachos-v2-root .program-step-card__status-text{
  font-size:var(--fs-sm);
  color:var(--color-text);
  font-weight:600;
  margin-top:-4px;
}
#coachos-v2-root .program-step-card__status-text--complete{
  color:var(--color-success);
}
#coachos-v2-root .program-step-card__media{
  width:calc(var(--space-6) * 4.5);
  height:calc(var(--space-6) * 4.5);
  border-radius:10px;
  overflow:hidden;
  flex:0 0 auto;
  background:var(--surface-2);
}
#coachos-v2-root .journal-step-card__layout{
  display:flex;
  align-items:center;
  gap:var(--space-3);
}
#coachos-v2-root .journal-step-card__body{
  flex:1 1 auto;
}
#coachos-v2-root .journal-step-card__body .coachos-v2-content{
  font-size:var(--fs-sm);
  margin-bottom:10px;
}
#coachos-v2-root .journal-step-card__status{
  font-size:var(--fs-sm);
  color:var(--color-text);
  font-weight:600;
  margin-top:5px;
}
#coachos-v2-root .journal-step-card__status--complete{
  color:var(--color-success);
}

#coachos-v2-root .journal-step-card__media{
  width:calc(var(--space-6) * 4.5);
  height:calc(var(--space-6) * 4.5);
  border-radius:10px;
  overflow:hidden;
  flex:0 0 auto;
  background:var(--surface-2);
}
#coachos-v2-root .journal-step-card__media img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

#coachos-v2-root .coach-min{
  display:flex; align-items:center; justify-content:space-between; gap:var(--space-4);
}
#coachos-v2-root .coach-min__left{
  display:flex; align-items:center; gap:var(--space-4);
}
#coachos-v2-root .coach-min__avatar{
  width:64px; height:64px; border-radius:50%; object-fit:cover;
}
#coachos-v2-root .coach-min__label{
  letter-spacing:.18em; font-size:.75rem; opacity:.7;
}
#coachos-v2-root .coach-min__name{
  font-weight:600; font-size:1.125rem;
}

#coachos-v2-root .coach-page__hero{
  display:flex; align-items:center; gap:var(--space-4);
}
#coachos-v2-root .coach-page__hero-avatar{
  width:72px; height:72px; border-radius:50%; object-fit:cover;
}
#coachos-v2-root .coach-page__hero-name{
  font-size:1.5rem; font-weight:600;
}
#coachos-v2-root .coach-page__inline-header{
  display:flex; align-items:center; gap:var(--space-3);
}
#coachos-v2-root .coach-page__inline-header__meta{
  display:flex; align-items:center; gap:var(--space-3);
}
#coachos-v2-root .coach-page__back{
  color:#fff; border-color:rgba(255,255,255,.4);
}
#coachos-v2-root .fs-header .coach-page__back{
  border-color:rgba(255,255,255,.4); color:#fff;
}
#coachos-v2-root .coach-q{
  background:var(--color-panel); border:1px solid var(--color-border); border-radius:var(--radius-4);
}
#coachos-v2-root .fs-route .coachos-v2-card.coach-q{
  background:var(--color-panel); border:1px solid var(--color-border); border-radius:var(--radius-4);
}
#coachos-v2-root [data-qlist] .coach-q + .coach-q{
  margin-top:var(--space-4);
}
#coachos-v2-root .coach-q__header{
  display:flex; justify-content:space-between; align-items:flex-start; gap:var(--space-3);
}
#coachos-v2-root .coach-q__title{
  font-size:1.05rem; font-weight:600; margin:0;
}
#coachos-v2-root .coach-q__delete{
  border:none; background:transparent; color:inherit; cursor:pointer; padding:var(--space-1);
}
#coachos-v2-root .coach-q__body{ margin-top:var(--space-3); }
#coachos-v2-root .coach-q__text{ margin:0 0 var(--space-2); }
#coachos-v2-root .coach-q__readmore{
  border:none; background:transparent; color:var(--accent); font-size:.9rem; cursor:pointer; padding:0;
}
#coachos-v2-root .coach-q__upvote{
  border-color:var(--color-border);
}
#coachos-v2-root .coach-q__response{ margin-top:var(--space-3); }
#coachos-v2-root .coach-q__response-label{
  letter-spacing:.18em; font-size:.75rem; opacity:.7; margin-bottom:var(--space-1);
}
#coachos-v2-root .coach-q__footer{
  display:flex; justify-content:space-between; align-items:center; gap:var(--space-3); margin-top:var(--space-4);
}
#coachos-v2-root .coach-q__meta{
  display:flex; align-items:center; gap:var(--space-2); font-size:.85rem;
}
#coachos-v2-root .coach-q__meta-text{
  display:flex; flex-direction:column; line-height:1.2;
}
#coachos-v2-root .coach-q__avatar{
  width:32px; height:32px; border-radius:50%; object-fit:cover;
}
#coachos-v2-root .coach-q__time{
  font-size:.75rem; color:var(--color-muted);
}
#coachos-v2-root .coach-q__header-row{
  display:flex; align-items:center; justify-content:space-between; margin-bottom:var(--space-3);
  gap:var(--space-3); flex-wrap:wrap;
}

#coachos-v2-root .coach-poll{
  display:flex; flex-direction:column; gap:var(--space-2); margin-top:var(--space-2);
}
#coachos-v2-root .coach-poll__option{
  width:100%; border:1px solid var(--color-border); background:var(--surface-3); border-radius:var(--radius-3);
  padding:var(--space-3); cursor:pointer; text-align:left; color:inherit;
}
#coachos-v2-root .coach-poll__option--selected{
  border-color:var(--accent); background:color-mix(in srgb, var(--accent) 12%, var(--surface-3) 88%);
}
#coachos-v2-root .coach-poll__option:disabled{
  opacity:.6;
}
#coachos-v2-root .coach-poll__row{
  display:flex; justify-content:space-between; align-items:center; margin-bottom:var(--space-2);
}
#coachos-v2-root .coach-poll__label{
  font-weight:600;
}
#coachos-v2-root .coach-poll__bar{
  width:100%; height:8px; border-radius:var(--radius-pill); background:var(--color-panel-subtle); overflow:hidden;
}
#coachos-v2-root .coach-poll__fill{
  display:block; height:100%; background:var(--accent);
}

#coachos-v2-root .coach-page{
  display:flex; flex-direction:column; gap:var(--space-4);
}
#coachos-v2-root .fs-route .coach-page.fills-full ~ .fs-content,
#coachos-v2-root .coach-page.fills-full{
  padding:0;
}
#coachos-v2-root .coach-page__body,
#coachos-v2-root .fs-route.coach-page.fills-full > .fs-content{
  padding:0;
}
#coachos-v2-root .coach-page__modal{
  position:fixed; inset:0; background:rgba(0,0,0,.45);
  display:flex; align-items:center; justify-content:center;
  padding:var(--space-5); z-index:60;
}
#coachos-v2-root .coach-page__modal[hidden]{ display:none; }
#coachos-v2-root .coach-page__modal__panel{
  width:min(520px,100%); background:var(--color-panel); border-radius:var(--radius-4);
  padding:var(--space-5); box-shadow:var(--shadow-2);
  display:flex; flex-direction:column; gap:var(--space-4);
}
#coachos-v2-root .coach-page__modal__panel label{
  display:flex; flex-direction:column; gap:var(--space-2); font-size:.9rem;
}

/* ========== 4) COMPONENTS (thin composition using primitives) ========== */

/* App shell / header / nav */
#coachos-v2-root .coachos-v2-app{ display:flex; flex-direction:column; min-height:100%; }
#coachos-v2-root .coachos-v2-app-header-host{ position:relative; z-index:20; }
#coachos-v2-root .coachos-v2-app-header{
  position:fixed;
  top:0;
  left:0;
  right:0;
  z-index:20;
  background:var(--color-bg);
  border-bottom:1px solid var(--color-border);
  padding-top:var(--space-4);
  padding-bottom:var(--space-4);
  padding-left:var(--gutter-x, var(--space-5));
  padding-right:var(--gutter-x, var(--space-5));
  min-height:var(--header-h,56px);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:var(--space-4);
  box-shadow:none;
  border-radius:0;
  transform:none;
}

/* Hide global header when fullscreen route is active */
body.coachos-v2--fs-active #coachos-v2-root .coachos-v2-app-header{
  opacity:0;
  pointer-events:none;
  visibility:hidden;
  transform:translateY(-100%);
  transition:transform var(--dur-2) var(--ease), opacity var(--dur-2) var(--ease);
}
#coachos-v2-root .coachos-v2-app-header:hover{
  box-shadow:none;
  transform:none;
}
#coachos-v2-root .coachos-v2-app-header__actions .coachos-v2-button{ min-width:auto; }
#coachos-v2-root .coachos-v2-app-nav{ display:flex; gap:.75rem; }
#coachos-v2-root .coachos-v2-app-nav__tab{
  appearance:none; border:none; background:transparent; padding:.5rem .5rem; border-radius:var(--radius-pill);
  font-size:.95rem; font-weight:500; color:var(--color-muted); cursor:pointer;
}
#coachos-v2-root .coachos-v2-app-nav__tab--active{ background:var(--color-panel-subtle); color:var(--color-text); font-weight:600; }

/* Offline ribbon + Error banner + Retry Center (use tokens) */
#coachos-v2-root .coachos-v2-offline-ribbon{
  position:sticky; top:0; z-index:5; margin-bottom:.75rem; padding:.4rem .75rem; border-radius:var(--radius-2);
  background: color-mix(in oklab, var(--color-warning) 16%, var(--color-panel) 84%); color: var(--color-warning); border:1px solid var(--color-border);
}
#coachos-v2-root .coachos-v2-error-banner{
  display:flex; align-items:flex-start; gap:.75rem; padding:.65rem .85rem; border-radius:var(--radius-3);
  background: color-mix(in oklab, var(--color-danger) 16%, var(--color-panel) 84%); border:1px solid var(--color-border); color: var(--color-danger); font-size:.9rem; margin-bottom:.75rem;
}

/* Decision tile */
#coachos-v2-root .coachos-v2-decision .decision__title{ font-weight:600; margin-bottom:var(--space-2); }
#coachos-v2-root .coachos-v2-decision .decision__rationale{ color:var(--color-muted); font-size:var(--fs-sm); }
#coachos-v2-root .coachos-v2-decision .decision__actions{ display:flex; gap:var(--space-3); margin-top:var(--space-4); }

/* DM list */
#coachos-v2-root .coachos-v2-dm-view{ display:flex; flex-direction:column; gap:var(--space-4); }
#coachos-v2-root .coachos-v2-dm-view .coachos-v2-content{ display:flex; flex-direction:column; gap:var(--space-3); }
#coachos-v2-root .coachos-v2-dm-list{ display:flex; flex-direction:column; gap:var(--space-3); margin:0; }
#coachos-v2-root .coachos-v2-dm-thread{ cursor:pointer; transition:background-color .15s ease, border-color .15s ease; border:none; padding:0; }
#coachos-v2-root .coachos-v2-dm-thread:hover{ background: color-mix(in oklab, var(--color-panel-subtle) 90%, var(--color-panel) 10%); border-color: color-mix(in oklab, var(--color-border) 70%, transparent 30%); }
#coachos-v2-root .coachos-v2-dm-row{ align-items:center; gap:var(--space-3); padding:var(--space-5); background:transparent; border:none; }
#coachos-v2-root .coachos-v2-dm-meta{ flex:1; min-width:0; }
#coachos-v2-root .coachos-v2-dm-top{ display:flex; align-items:baseline; justify-content:space-between; gap:var(--space-3); }
#coachos-v2-root .coachos-v2-dm-name{ font-size:var(--fs-sm); font-weight:600; color:var(--color-text); }
#coachos-v2-root .coachos-v2-dm-time{ color:var(--color-muted); font-size:var(--fs-xs); white-space:nowrap; }
#coachos-v2-root .coachos-v2-dm-preview{ margin-top:4px; color:var(--color-muted); font-size:var(--fs-sm); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#coachos-v2-root .coachos-v2-dm-avatar{ width:40px; height:40px; border-radius:50%; overflow:hidden; background: color-mix(in oklab, var(--color-panel-subtle) 80%, var(--color-border) 20%); display:inline-flex; align-items:center; justify-content:center; font-weight:600; color:var(--color-muted); text-transform:uppercase; }
#coachos-v2-root .coachos-v2-dm-avatar img{ width:100%; height:100%; object-fit:cover; }
#coachos-v2-root .coachos-v2-dm-avatar--header{
  width:40px;
  height:40px;
  border-radius:var(--radius-pill);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  background: color-mix(in oklab, var(--color-panel-subtle) 80%, var(--color-border) 20%);
  font-weight:600;
  color:var(--color-text);
  text-transform:uppercase;
}
#coachos-v2-root .coachos-v2-dm-avatar--header img{ width:100%; height:100%; object-fit:cover; }
#coachos-v2-root .coachos-v2-dm-avatar--placeholder{ font-size:var(--fs-sm); }
#coachos-v2-root .coachos-v2-dm-skeleton{ height:56px; border-radius:var(--radius-3); background: color-mix(in oklab, var(--color-panel-subtle) 92%, var(--color-border) 8%); animation: coachos-v2-dm-pulse 1.2s ease-in-out infinite; }
#coachos-v2-root .coachos-v2-dm-empty .coachos-v2-content,
#coachos-v2-root .coachos-v2-dm-error .coachos-v2-content{ margin-top:var(--space-2); }
#coachos-v2-root .coachos-v2-dm-empty .u-stack-sm,
#coachos-v2-root .coachos-v2-dm-error .coachos-v2-button{ margin-top:var(--space-3); }
#coachos-v2-root .coachos-v2-dm-list .coachos-v2-chip{ margin-left:auto; }
#coachos-v2-root .coachos-v2-dm-chip{ display:inline-flex; }
#coachos-v2-root .coachos-v2-dm-list .coachos-v2-chip[data-unread]{ min-width:2.25rem; justify-content:center; font-weight:700; }
@keyframes coachos-v2-dm-pulse{ 0%{ opacity:.45; } 50%{ opacity:.88; } 100%{ opacity:.45; } }
/* Legacy badge support */
#coachos-v2-root .coachos-v2-dm-unread{ background: var(--color-danger); color:#fff; border-radius:var(--radius-pill); padding:.1rem .5rem; font-size:.75rem; font-weight:600; }

/* DM thread */
#coachos-v2-root .coachos-v2-dm-thread{ flex:1; display:flex; flex-direction:column; background:transparent; }
#coachos-v2-root .coachos-v2-dm-list .coachos-v2-dm-thread{
  background:var(--color-panel);
  border:1px solid var(--color-border);
  border-radius:var(--radius-4);
}
#coachos-v2-root .coachos-v2-dm-list .coachos-v2-dm-thread:hover{
  background: color-mix(in oklab, var(--color-panel-subtle) 90%, var(--color-panel) 10%);
  border-color: color-mix(in oklab, var(--color-border) 70%, transparent 30%);
}
#coachos-v2-root .coachos-v2-dm-thread__header{ justify-content:flex-start; display:flex; align-items:center; gap:var(--space-4); padding:var(--space-4) var(--space-6); border-bottom:1px solid color-mix(in oklab, var(--color-border) 65%, transparent 35%); background: color-mix(in srgb, var(--color-panel) 70%, transparent 30%); backdrop-filter:blur(18px); -webkit-backdrop-filter:blur(18px); position:sticky; top:0; z-index:4; box-shadow:var(--shadow-2); isolation:isolate; }
#coachos-v2-root .coachos-v2-dm-thread-error{
  display:flex;
  flex-direction:column;
  gap:var(--space-4);
}
#coachos-v2-root .coachos-v2-dm-thread-error .coachos-v2-card{
  background:color-mix(in oklab, var(--color-panel) 90%, var(--color-danger) 10%);
  border:1px solid color-mix(in oklab, var(--color-danger) 35%, var(--color-border) 65%);
  box-shadow:var(--shadow-sm);
}
#coachos-v2-root .coachos-v2-dm-thread__header .coachos-v2-dm-avatar{ width:40px; height:40px; border-radius:50%; overflow:hidden; display:inline-flex; align-items:center; justify-content:center; font-weight:600; background: color-mix(in oklab, var(--color-panel-subtle) 80%, var(--color-border) 20%); }
#coachos-v2-root .coachos-v2-dm-thread__header .coachos-v2-dm-avatar img{ width:100%; height:100%; object-fit:cover; }
#coachos-v2-root .coachos-v2-dm-thread__title{ display:flex; flex-direction:column; gap:4px; justify-content:center; }
#coachos-v2-root .coachos-v2-dm-thread__title .coachos-v2-header{ margin:0; }
#coachos-v2-root .coachos-v2-dm-thread__scroll{ flex:1; overflow:auto; padding:0; display:flex; flex-direction:column; gap:var(--space-3); position:relative; background:transparent; }
#coachos-v2-root .coachos-v2-dm-thread__loading{ display:flex; flex-direction:column; gap:var(--space-3); }
#coachos-v2-root .coachos-v2-dm-thread__empty{ margin:var(--space-6) auto; text-align:center; opacity:.7; }
#coachos-v2-root .coachos-v2-dm-daywrap{
  display:flex;
  justify-content:center;
  width:100%;
  margin:var(--space-6) 0 var(--space-4);
}
#coachos-v2-root .coachos-v2-dm-day{
  display:inline-flex;
  flex:0 0 auto;
  padding:6px 16px;
  border-radius:var(--radius-pill);
  background: color-mix(in oklab, var(--color-panel) 85%, transparent 15%);
  border:1px solid var(--color-border);
  font-size:var(--fs-xs);
  font-weight:600;
  letter-spacing:.08em;
  width:auto;
  justify-content:center;
  text-align:center;
  margin:0 auto;
}
#coachos-v2-root .coachos-v2-dm-bubble{ position:relative; max-width:min(75%, 520px); padding:var(--space-3) var(--space-4); border-radius:var(--radius-4); box-shadow:var(--shadow-1); display:flex; flex-direction:column; gap:var(--space-2); }
#coachos-v2-root .coachos-v2-dm-bubble--them{ align-self:flex-start; background:var(--color-panel); border:1px solid var(--color-border); color:var(--color-text); }
#coachos-v2-root .coachos-v2-dm-bubble--me{ align-self:flex-end; background:var(--color-primary); color:#fff; }
#coachos-v2-root .coachos-v2-dm-bubble--me .coachos-v2-dm-bubble__reply{ border-left-color: color-mix(in oklab, #fff 40%, var(--color-primary) 60%); color: color-mix(in oklab, #fff 80%, var(--color-primary) 20%); }
#coachos-v2-root .coachos-v2-dm-bubble__reply{ font-size:var(--fs-xs); color:var(--color-muted); padding-left:var(--space-3); border-left:2px solid var(--color-border); margin-bottom:4px; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#coachos-v2-root .coachos-v2-dm-bubble__body{ word-break:break-word; }
#coachos-v2-root .coachos-v2-dm-bubble__body p{ margin:0; }
#coachos-v2-root .coachos-v2-dm-bubble__meta{ display:flex; align-items:center; gap:var(--space-3); font-size:var(--fs-xs); color:var(--color-muted); min-height:0; height:0; overflow:hidden; }
#coachos-v2-root .coachos-v2-dm-bubble--them.stack-start{ border-bottom-left-radius:var(--radius-2); }
#coachos-v2-root .coachos-v2-dm-bubble--them.stack-middle{ border-top-left-radius:var(--radius-2); border-bottom-left-radius:var(--radius-2); }
#coachos-v2-root .coachos-v2-dm-bubble--them.stack-end{ border-top-left-radius:var(--radius-2); }
#coachos-v2-root .coachos-v2-dm-bubble--me.stack-start{ border-bottom-right-radius:var(--radius-2); }
#coachos-v2-root .coachos-v2-dm-bubble--me.stack-middle{ border-top-right-radius:var(--radius-2); border-bottom-right-radius:var(--radius-2); }
#coachos-v2-root .coachos-v2-dm-bubble--me.stack-end{ border-top-right-radius:var(--radius-2); }
#coachos-v2-root .coachos-v2-dm-status{ opacity:.75; }
#coachos-v2-root .coachos-v2-dm-retry{ background:none; border:none; color:var(--color-danger); font-size:var(--fs-xs); cursor:pointer; text-decoration:underline; }
#coachos-v2-root .coachos-v2-dm-reactions{ position:absolute; display:flex; flex-wrap:wrap; gap:4px; margin-top:0; }
#coachos-v2-root .coachos-v2-dm-bubble--them .coachos-v2-dm-reactions{ top:-18px; right:12px; justify-content:flex-end; }
#coachos-v2-root .coachos-v2-dm-bubble--me .coachos-v2-dm-reactions{ top:-18px; left:12px; justify-content:flex-start; }
#coachos-v2-root .coachos-v2-dm-reaction{ border:none; border-radius:var(--radius-pill); padding:4px 8px; background: color-mix(in oklab, var(--color-panel) 85%, transparent 15%); font-size:var(--fs-xs); cursor:pointer; color:var(--color-text); box-shadow:var(--shadow-1); }
#coachos-v2-root .coachos-v2-dm-reaction.is-mine{ background: color-mix(in oklab, var(--color-primary) 22%, var(--color-panel) 78%); color:var(--color-primary); font-weight:600; }
#coachos-v2-root .coachos-v2-dm-actions{
  position:absolute;
  display:flex;
  gap:var(--space-2);
  padding:6px 8px;
  border-radius:var(--radius-pill);
  background:var(--color-panel);
  border:1px solid var(--color-border);
  box-shadow:var(--shadow-1);
  z-index:6;
  top:-44px;
  right:0;
}
#coachos-v2-root .coachos-v2-dm-msg--coach .coachos-v2-dm-actions{
  left:0;
  right:auto;
}
#coachos-v2-root .coachos-v2-dm-actions[hidden]{ display:none; }
#coachos-v2-root .coachos-v2-dm-action{ border:none; background:transparent; cursor:pointer; font-size:var(--fs-md); line-height:1; padding:4px; border-radius:var(--radius-pill); color:var(--color-text); }
#coachos-v2-root .coachos-v2-dm-action:hover{ background: color-mix(in oklab, var(--color-panel-subtle) 85%, transparent 15%); }
#coachos-v2-root .coachos-v2-dm-action--reply{ font-size:var(--fs-xs); text-transform:uppercase; letter-spacing:.08em; font-weight:600; color:var(--color-muted); }
#coachos-v2-root .coachos-v2-dm-composer{ padding:var(--space-3) var(--space-6); border-top:1px solid var(--color-border); background:var(--color-panel); display:flex; flex-direction:column; gap:var(--space-3); position:sticky; bottom:0; }
#coachos-v2-root .coachos-v2-dm-composer__inner{ display:flex; align-items:center; gap:var(--space-3); width:100%; }
#coachos-v2-root .coachos-v2-dm-composer__status{
  margin-top:var(--space-2);
  font-size:var(--fs-xs);
  color:var(--color-muted);
  min-height:1.2em;
}
#coachos-v2-root .coachos-v2-dm-composer__status[data-state="success"]{ color:var(--color-success); }
#coachos-v2-root .coachos-v2-dm-composer__status[data-state="error"]{ color:var(--color-danger); }
#coachos-v2-root .coachos-v2-dm-reply{ display:none; align-items:center; gap:var(--space-3); padding:var(--space-2) var(--space-3); border-radius:var(--radius-3); background: color-mix(in oklab, var(--color-panel-subtle) 88%, transparent 12%); border:1px solid var(--color-border); }
#coachos-v2-root .coachos-v2-dm-reply:not([hidden]){ display:flex; }
#coachos-v2-root .coachos-v2-dm-reply__label{ font-size:var(--fs-xs); font-weight:600; color:var(--color-muted); }
#coachos-v2-root .coachos-v2-dm-reply__text{ flex:1; font-size:var(--fs-sm); color:var(--color-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#coachos-v2-root .coachos-v2-dm-reply__close{ border:none; background:transparent; font-size:var(--fs-md); cursor:pointer; color:var(--color-muted); }
#coachos-v2-root .coachos-v2-dm-bubble.is-failed{ border:1px dashed var(--color-danger); background: color-mix(in oklab, var(--color-danger) 12%, var(--color-panel) 88%); }
#coachos-v2-root .coachos-v2-dm-bubble.is-sending{ opacity:.7; }
#coachos-v2-root .coachos-v2-dm-composer .coachos-v2-dm-composer__status:empty{
  margin:0;
  min-height:0;
  display:none;
}
#coachos-v2-root .coachos-v2-chat__composer .coachos-v2-dm-composer__status:empty{
  margin:0;
  min-height:0;
  display:none;
}
#coachos-v2-root .fs-route .coachos-v2-dm-composer{
  position:static;
  bottom:auto;
  padding:0;
  border:none;
  background:transparent;
  box-shadow:none;
}
#coachos-v2-root .fs-route .coachos-v2-dm-composer__status{
  margin-top:var(--space-1);
}

/* Chat stage */
#coachos-v2-root .coachos-v2-card.coachos-v2-chat{
  padding:0;
  display:flex;
  flex-direction:column;
  gap:0;
}
#coachos-v2-root .coachos-v2-chat{
  contain:none;
  flex:1 1 auto;
  display:flex;
  flex-direction:column;
}
#coachos-v2-root .coachos-v2-chat__log{
  flex:1 1 auto;
  overflow:auto;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:.75rem;
}
#coachos-v2-root .coachos-v2-chat__log--coach{
  padding-bottom:0;
  background:transparent;
}
#coachos-v2-root .coachos-v2-chat__log::-webkit-scrollbar{
  width:6px;
}
#coachos-v2-root .coachos-v2-chat__log::-webkit-scrollbar-thumb{
  background: color-mix(in oklab,var(--color-border) 80%,transparent 20%);
  border-radius:var(--radius-pill);
}
#coachos-v2-root .coachos-v2-chat__log::-webkit-scrollbar-track{
  background: transparent;
}
#coachos-v2-root .coachos-v2-chat__composer{
  padding:var(--space-3) 0;
  border-top:1px solid var(--color-border);
  background:transparent;
  display:flex;
  flex-direction:column;
  gap:0.25rem;
}
#coachos-v2-root .coachos-v2-chat__composer--coach{
  border-top:none;
}
#coachos-v2-root.theme-light .coachos-v2-chat__composer--coach{
  background:linear-gradient(180deg, color-mix(in srgb, var(--color-panel) 85%, transparent) 0%, transparent 100%);
}
@supports (padding: env(safe-area-inset-bottom)){
  #coachos-v2-root .coachos-v2-chat__composer{
    padding-bottom:calc(var(--space-3) + env(safe-area-inset-bottom));
  }
}

/* ===== ChatGPT-style Composer ===== */
#coachos-v2-root .coachos-v2-composer-wrap{
  position:relative;
  display:flex;
  align-items:center;
  background:var(--color-panel-subtle);
  border:1px solid var(--color-border);
  border-radius:9999px;
  padding-right:48px;
  flex:1 1 auto;
}
#coachos-v2-root .coachos-v2-composer-textarea{
  flex:1;
  width:100%;
  min-height:46px;
  max-height:140px;
  padding:14px 18px;
  border:none;
  outline:none;
  background:transparent;
  color:var(--color-text);
  resize:none;
  overflow-y:hidden;
  font-family:inherit;
  font-size:1rem;
  line-height:1.45;
}
#coachos-v2-root .coachos-v2-composer-textarea::placeholder{
  color:rgba(255,255,255,0.5);
}
#coachos-v2-root .coachos-v2-send-button{
  position:absolute;
  right:4px;
  bottom:4px;
  width:40px;
  height:40px;
  border-radius:9999px;
  border:none;
  outline:none;
  background:#ffffff;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  box-shadow:0 2px 6px rgba(0,0,0,0.2);
  transition:transform 0.15s ease, box-shadow 0.15s ease;
  padding:0;
}
#coachos-v2-root .coachos-v2-send-button:hover{
  transform:translateY(-1px);
  box-shadow:0 4px 10px rgba(0,0,0,0.25);
}
#coachos-v2-root .coachos-v2-send-button:disabled{
  opacity:0.6;
  cursor:not-allowed;
  box-shadow:none;
  transform:none;
}
#coachos-v2-root .coachos-v2-send-icon{
  width:24px;
  height:24px;
  object-fit:contain;
}
#coachos-v2-root .coachos-v2-fab .coachos-v2-send-icon{
  width:28px;
  height:28px;
}

#coachos-v2-root .coachos-v2-input--textarea{
  resize:none;
  line-height:1.45;
}

/* Chat bar */
#coachos-v2-root .coachos-v2-chatbar{
  position:sticky;
  top:0;
  z-index:15;
  display:flex;
  align-items:center;
  gap:var(--space-3);
  background:var(--color-bg);
  padding:var(--space-3) var(--space-4);
  border-bottom:1px solid var(--color-border);
}
#coachos-v2-root .coachos-v2-chatbar__back{
  appearance:none;
  border:none;
  background:transparent;
  cursor:pointer;
  width:40px;
  height:40px;
  border-radius:9999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:inherit;
}
#coachos-v2-root .coachos-v2-chatbar__title{
  font-size:var(--fs-xl);
  font-weight:700;
  display:flex;
  align-items:center;
  gap:var(--space-3);
}
#coachos-v2-root .coachos-v2-chatbar__avatar{
  width:32px;
  height:32px;
  border-radius:9999px;
  object-fit:cover;
}
@supports (padding: env(safe-area-inset-top)){
  #coachos-v2-root .coachos-v2-chatbar{
    padding-top:calc(var(--space-3) + env(safe-area-inset-top));
  }
}
#coachos-v2-root .coachos-v2-dm-thread__list::-webkit-scrollbar{
  width:6px;
}
#coachos-v2-root .coachos-v2-dm-thread__list::-webkit-scrollbar-thumb{
  background: color-mix(in oklab,var(--color-border) 80%,transparent 20%);
  border-radius:var(--radius-pill);
}
#coachos-v2-root .coachos-v2-dm-thread__list::-webkit-scrollbar-track{
  background: transparent;
}
@supports (padding: env(safe-area-inset-bottom)){
  #coachos-v2-root .coachos-v2-dm-composer{
    padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom));
  }
}

#coachos-v2-root .coachos-v2-fab{
  position:fixed;
  right:24px;
  bottom:24px;
  z-index:30;
  width:56px;
  height:56px;
  border-radius:9999px;
  border:1px solid var(--color-border);
  background:var(--color-panel);
  color:var(--color-text);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  box-shadow:var(--shadow-2);
  cursor:pointer;
  transition:transform var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
  padding:0;
}
#coachos-v2-root .coachos-v2-fab.is-hidden{
  display:none !important;
}
#coachos-v2-root.is-cohort-chat .coachos-v2-fab{
  display:none!important;
}
#coachos-v2-root .coachos-v2-fab:hover{
  transform:translateY(-1px);
  box-shadow:var(--shadow-2);
}
@supports (padding: env(safe-area-inset-bottom)){
  #coachos-v2-root .coachos-v2-fab{
    right:calc(24px + env(safe-area-inset-right));
    bottom:calc(24px + env(safe-area-inset-bottom));
  }
}
#coachos-v2-root .coachos-v2-dm-msg__bubble{
  background: var(--color-panel-subtle);
  border:1px solid var(--color-border);
  border-radius:14px;
  padding:.6rem .9rem;
  max-width:80%;
  min-height:36px;
  display:flex;
  flex-direction:column;
  gap:.35rem;
  align-items:flex-start;
  position:relative;
}
#coachos-v2-root .coachos-v2-dm-msg__bubble--me{ background: var(--color-panel); }
#coachos-v2-root .coachos-v2-dm-msg__bubble--typing{ background:var(--color-panel-subtle); border:1px solid var(--color-border); display:flex; align-items:center; gap:.35rem; padding:.5rem .9rem; min-height:36px; }
#coachos-v2-root .coachos-v2-dm-msg{
  display:flex;
  justify-content:flex-start;
  gap:var(--space-3);
  margin-top:var(--space-2);
}
#coachos-v2-root .coachos-v2-dm-msg:first-of-type{
  margin-top:0;
}
#coachos-v2-root .coachos-v2-dm-msg--separated{
  margin-top:var(--space-4);
}
#coachos-v2-root .coachos-v2-dm-msg--stacked .coachos-v2-dm-msg__bubble{
  border-top-left-radius:8px;
  border-top-right-radius:8px;
}
#coachos-v2-root .coachos-v2-dm-msg--coach{ justify-content:flex-start; }
#coachos-v2-root .coachos-v2-dm-msg--coach .coachos-v2-dm-msg__bubble{
  background: color-mix(in oklab, var(--color-panel) 92%, var(--accent) 8%);
  border-color: color-mix(in oklab, var(--color-border) 70%, var(--accent) 30%);
}
#coachos-v2-root .coachos-v2-dm-msg--me{ justify-content:flex-end; }
#coachos-v2-root .coachos-v2-typing{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  padding:0 var(--space-4);
  min-height:24px;
}
#coachos-v2-root .coachos-v2-dm-msg__bubble--typing{
  display:flex;
  flex-direction:row;
  align-items:center;
  justify-content:center;
  column-gap:4px;
}
#coachos-v2-root .coachos-v2-typing-dot{
  display:inline-block;
  width:8px;
  height:8px;
  border-radius:9999px;
  background:var(--color-muted);
  opacity:0.4;
  animation: coachos-v2-typing-bounce 1.1s infinite ease-in-out;
}
#coachos-v2-root .coachos-v2-typing-dot:nth-child(2){ animation-delay:0.15s; }
#coachos-v2-root .coachos-v2-typing-dot:nth-child(3){ animation-delay:0.3s; }

@keyframes coachos-v2-typing-bounce{
  0%, 80%, 100% { transform:scale(0.6); opacity:0.2; }
  40% { transform:scale(1); opacity:0.6; }
}

/* === Overview Members (feature skin inside a card) === */
#coachos-v2-root .overview-members{
  display:grid;
  row-gap:var(--space-3);
}
#coachos-v2-root .overview-members__scroller{
  display:grid;
  grid-auto-flow:column;
  grid-auto-columns:min-content;
  gap:var(--space-4);
  overflow-x:auto;
  scrollbar-width:none;
  padding:var(--space-1) var(--space-1) var(--space-2);
  scroll-padding-left:calc(var(--space-1) + 20px);
  scroll-snap-type:x mandatory;
}
#coachos-v2-root .overview-members__scroller::before{
  content:'';
  width:20px;
  height:1px;
  display:block;
  pointer-events:none;
}
#coachos-v2-root .overview-members__scroller::-webkit-scrollbar{
  display:none;
}
#coachos-v2-root .overview-members__item{
  display:grid;
  justify-items:center;
  gap:var(--space-2);
  min-width:64px;
  scroll-snap-align:start;
  text-align:center;
  color:var(--color-text);
  border:0;
  background:transparent;
  box-shadow:none;
  cursor:pointer;
  padding:0;
}
#coachos-v2-root .overview-members__avatar{
  width:64px;
  height:64px;
  aspect-ratio:1 / 1;
  border-radius:var(--radius-pill);
  object-fit:cover;
  display:block;
  box-shadow:var(--shadow-1);
  overflow:hidden;
  flex-shrink:0;
  transition:transform var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
#coachos-v2-root .overview-members__item:hover .overview-members__avatar,
#coachos-v2-root .overview-members__item:hover .overview-members__avatar--initials{
  box-shadow:var(--shadow-2);
  transform:translateY(-1px);
}
#coachos-v2-root .overview-members__avatar--initials{
  width:64px;
  height:64px;
  aspect-ratio:1 / 1;
  border-radius:var(--radius-pill);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-weight:600;
  font-size:var(--fs-sm);
  background:color-mix(in oklab, var(--color-panel-subtle) 85%, var(--color-border) 15%);
  color:var(--color-text);
  box-shadow:var(--shadow-1);
  text-transform:uppercase;
  transition:transform var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
#coachos-v2-root .overview-members__avatar-skeleton{
  width:64px;
  height:64px;
  border-radius:var(--radius-pill);
  display:block;
}
#coachos-v2-root .overview-members__item:focus-visible{
  outline:2px solid color-mix(in oklab, var(--color-primary) 70%, #ffffff 30%);
  outline-offset:3px;
}
#coachos-v2-root .overview-members__name{
  font-size:var(--fs-xs);
  color:var(--color-muted);
  transition:color var(--dur-1) var(--ease);
}
#coachos-v2-root .edge-fade-x{
  -webkit-mask-image:linear-gradient(to right, transparent 0, black 16px, black calc(100% - 16px), transparent 100%);
  mask-image:linear-gradient(to right, transparent 0, black 16px, black calc(100% - 16px), transparent 100%);
}

/* Journal list + modal */
#coachos-v2-root .coachos-v2-journal-list{ display:flex; flex-direction:column; gap:.75rem; }
#coachos-v2-root .coachos-v2-journal-row{ /* inherits list row primitive via shared selector */ }
#coachos-v2-root .coachos-v2-journal-modal{ position:fixed; inset:0; background: rgba(0,0,0,.35); display:flex; align-items:center; justify-content:center; padding:var(--space-6); z-index:100; }
#coachos-v2-root .coachos-v2-journal-modal__content{ width:min(640px,100%); background:var(--color-panel); border-radius:var(--radius-4); padding:var(--space-6); box-shadow:var(--shadow-2); }

/* Pulse */
#coachos-v2-root .coachos-v2-pulse .pulse__bar{ height:8px; border-radius:var(--radius-pill); background: var(--color-panel-subtle); overflow:hidden; }
#coachos-v2-root .coachos-v2-pulse .pulse__bar-fill{ height:100%; background: var(--color-primary); }
#coachos-v2-root .coachos-v2-range{
  width:100%;
  -webkit-appearance:none;
  background:transparent;
}
#coachos-v2-root .coachos-v2-range:focus-visible{
  outline:2px solid color-mix(in oklab, var(--color-primary) 50%, #ffffff 20%);
  outline-offset:4px;
}
#coachos-v2-root .coachos-v2-range::-webkit-slider-runnable-track{
  height:8px;
  border-radius:var(--radius-pill);
  background:color-mix(in oklab, var(--color-panel-subtle) 80%, var(--color-border) 20%);
}
#coachos-v2-root .coachos-v2-range::-moz-range-track{
  height:8px;
  border-radius:var(--radius-pill);
  background:color-mix(in oklab, var(--color-panel-subtle) 80%, var(--color-border) 20%);
}
#coachos-v2-root .coachos-v2-range::-webkit-slider-thumb{
  -webkit-appearance:none;
  width:18px;
  height:18px;
  border-radius:var(--radius-pill);
  background:var(--color-primary);
  border:2px solid color-mix(in oklab, var(--color-panel) 80%, transparent 20%);
  box-shadow:var(--shadow-sm);
  margin-top:-5px;
}
#coachos-v2-root .coachos-v2-range::-moz-range-thumb{
  width:18px;
  height:18px;
  border-radius:var(--radius-pill);
  background:var(--color-primary);
  border:2px solid color-mix(in oklab, var(--color-panel) 80%, transparent 20%);
  box-shadow:var(--shadow-sm);
}
#coachos-v2-root .coachos-v2-range:disabled{
  opacity:.5;
  cursor:not-allowed;
}

/* Toasts */
#coachos-v2-root .coachos-v2-toasts{ position:fixed; bottom:24px; right:24px; display:flex; flex-direction:column; gap:.5rem; z-index:20; pointer-events:none; }
#coachos-v2-root .coachos-v2-toast{ min-width:220px; max-width:320px; background: var(--color-panel); color:var(--color-text); padding:.75rem 1rem; border-radius:var(--radius-3); box-shadow:var(--shadow-2); pointer-events:auto; }
#coachos-v2-root .coachos-v2-fallback-outlet{ display:flex; flex-direction:column; gap:var(--space-4); }

/* Avatar */
#coachos-v2-root .coachos-v2-avatar-button{ padding:var(--space-2); }
#coachos-v2-root .coachos-v2-avatar-img{ width:32px; height:32px; border-radius:var(--radius-pill); object-fit:cover; display:block; }
#coachos-v2-root .coachos-v2-avatar-initials{
  display:inline-flex; align-items:center; justify-content:center;
  width:32px; height:32px; border-radius:var(--radius-pill);
  font-weight:600; font-size:var(--fs-sm);
  background: color-mix(in oklab, var(--color-panel-subtle) 80%, var(--color-border) 20%);
  color: var(--color-text);
}

/* Profile */
#coachos-v2-root .coachos-v2-profile{
  display:flex;
  flex-direction:column;
  gap:var(--space-4);
}
#coachos-v2-root .coachos-v2-profile__header{
  display:flex;
  align-items:center;
  gap:var(--space-4);
}

#coachos-v2-root .coachos-v2-auth{
  align-items:center;
}
#coachos-v2-root .coachos-v2-auth.coachos-v2-route--padded{
  justify-content:center;
  padding-top:0;
  padding-bottom:0;
  min-height:100%;
}
#coachos-v2-root .coachos-v2-auth__card{
  width:min(540px, calc(100% - 40px));
  margin:0 auto;
  display:flex;
  flex-direction:column;
  gap:var(--space-4);
  padding:var(--space-6);
}
#coachos-v2-root .coachos-v2-auth__header{
  display:flex;
  flex-direction:column;
  gap:var(--space-2);
}
#coachos-v2-root .coachos-v2-auth__card--chooser{
  text-align:center;
  align-items:center;
}
#coachos-v2-root .coachos-v2-auth__card--chooser .coachos-v2-auth__header{
  align-items:center;
}
#coachos-v2-root .coachos-v2-auth__card--chooser .coachos-v2-header{
  font-size:var(--fs-hero);
}
#coachos-v2-root .coachos-v2-auth__card--chooser .coachos-v2-content{
  text-align:center;
}
#coachos-v2-root .coachos-v2-auth__card--login{
  text-align:center;
  align-items:center;
}
#coachos-v2-root .coachos-v2-auth__card--login .coachos-v2-auth__header{
  align-items:center;
  gap:var(--space-1);
  margin-bottom:var(--space-2);
}
#coachos-v2-root .coachos-v2-auth__card--login .coachos-v2-header{
  margin-bottom:var(--space-1);
}
#coachos-v2-root .coachos-v2-auth__card--login .coachos-v2-content{
  text-align:center;
  margin-bottom:var(--space-2);
}
#coachos-v2-root .coachos-v2-onboard{
  display:flex;
  flex-direction:column;
  gap:var(--space-4);
}
#coachos-v2-root .coachos-v2-onboard__progress{
  display:flex;
  flex-direction:column;
  gap:var(--space-2);
}
#coachos-v2-root .coachos-v2-onboard__progress-meta{
  display:flex;
  justify-content:space-between;
  font-size:var(--fs-sm);
  color:var(--color-muted);
}
#coachos-v2-root .coachos-v2-onboard__progress-track{
  height:6px;
  border-radius:var(--radius-pill);
  background:color-mix(in oklab, var(--color-border) 40%, transparent 60%);
  overflow:hidden;
}
#coachos-v2-root .coachos-v2-onboard__progress-bar{
  height:100%;
  background:var(--color-primary);
  border-radius:var(--radius-pill);
  transition:width var(--dur-2) var(--ease);
}
#coachos-v2-root .coachos-v2-onboard__fields{
  display:flex;
  flex-direction:column;
  gap:var(--space-4);
}
#coachos-v2-root .coachos-v2-onboard__field{
  padding:var(--space-4);
  border-radius:var(--radius-4);
  background:color-mix(in oklab, var(--color-panel-subtle) 85%, black 15%);
  border:1px solid color-mix(in oklab, var(--color-border) 60%, transparent 40%);
  display:flex;
  flex-direction:column;
  gap:var(--space-3);
}
#coachos-v2-root .coachos-v2-onboard__scale{
  display:flex;
  justify-content:space-between;
  font-size:var(--fs-xs);
  color:var(--color-muted);
  margin-bottom:var(--space-2);
}
#coachos-v2-root .coachos-v2-onboard__bubbles{
  display:flex;
  flex-wrap:wrap;
  gap:var(--space-3);
}
#coachos-v2-root .coachos-v2-onboard__bubble{
  width:52px;
  height:52px;
  border-radius:var(--radius-pill);
  border:1px solid color-mix(in oklab, var(--color-border) 80%, transparent 20%);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  position:relative;
  transition:border-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
#coachos-v2-root .coachos-v2-onboard__bubble span{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  height:100%;
  border-radius:var(--radius-pill);
}
#coachos-v2-root .coachos-v2-onboard__bubble input{
  position:absolute;
  inset:0;
  opacity:0;
  pointer-events:none;
}
#coachos-v2-root .coachos-v2-onboard__bubble span{
  font-weight:600;
  color:var(--color-text);
}
#coachos-v2-root .coachos-v2-onboard__bubble input:checked + span{
  color:#fff;
  background:var(--color-primary);
  border-radius:var(--radius-pill);
  box-shadow:0 0 0 1px color-mix(in oklab, var(--color-primary) 80%, transparent 20%);
}
#coachos-v2-root .coachos-v2-onboard__error{
  margin:var(--space-2) 0;
  padding:var(--space-3);
  border-radius:var(--radius-2);
  border:1px solid color-mix(in oklab, var(--color-danger) 45%, var(--color-border) 55%);
  background: color-mix(in oklab, var(--color-danger) 12%, var(--color-panel) 88%);
  color:var(--color-danger);
  font-size:var(--fs-sm);
}
#coachos-v2-root .coachos-v2-onboard__nav{
  display:flex;
  flex-direction:column;
  gap:var(--space-2);
  align-items:center;
}
#coachos-v2-root .coachos-v2-onboard__nav .coachos-v2-button{
  min-width:240px;
}
#coachos-v2-root .coachos-v2-auth__actions{
  display:flex;
  flex-wrap:wrap;
  gap:var(--space-3);
}
#coachos-v2-root .coachos-v2-auth__actions--stack{
  flex-direction:column;
  justify-content:center;
  align-items:center;
  width:100%;
}
#coachos-v2-root .coachos-v2-auth__actions--stack .coachos-v2-button{
  min-width:220px;
}
#coachos-v2-root .coachos-v2-auth__card--chooser .coachos-v2-button--ghost{
  border:none;
}
#coachos-v2-root .coachos-v2-auth__form{
  display:flex;
  flex-direction:column;
  gap:var(--space-3);
}
#coachos-v2-root .coachos-v2-auth__form--login{
  align-items:center;
  gap:var(--space-2);
}
#coachos-v2-root .coachos-v2-auth__form--login .coachos-v2-auth__field,
#coachos-v2-root .coachos-v2-auth__form--login .coachos-v2-auth__checkbox{
  width:100%;
  margin-bottom:var(--space-1);
}
#coachos-v2-root .coachos-v2-auth__form--login .coachos-v2-auth__checkbox{
  margin-bottom:var(--space-2);
}
#coachos-v2-root .coachos-v2-auth__form--login .coachos-v2-button--ghost{
  border:none;
}
#coachos-v2-root .coachos-v2-auth__form.is-busy{
  opacity:.65;
}
#coachos-v2-root .coachos-v2-auth__row{
  display:flex;
  flex-wrap:wrap;
  gap:var(--space-4);
}
#coachos-v2-root .coachos-v2-auth__field{
  display:flex;
  flex-direction:column;
  gap:var(--space-2);
}
#coachos-v2-root .coachos-v2-auth__row .coachos-v2-auth__field{
  flex:1 1 220px;
}
#coachos-v2-root .coachos-v2-auth__field--file input[type="file"]{
  margin-top:var(--space-2);
}
#coachos-v2-root .coachos-v2-auth__checkbox{
  display:flex;
  align-items:center;
  gap:var(--space-2);
  font-size:var(--fs-sm);
  color:var(--color-muted);
}
#coachos-v2-root .coachos-v2-auth__checkbox input{
  width:16px;
  height:16px;
}
#coachos-v2-root .coachos-v2-auth__error{
  padding:var(--space-3);
  border-radius:var(--radius-2);
  border:1px solid color-mix(in oklab, var(--color-danger) 45%, var(--color-border) 55%);
  background: color-mix(in oklab, var(--color-danger) 12%, var(--color-panel) 88%);
  color:var(--color-danger);
  font-size:var(--fs-sm);
}
#coachos-v2-root .coachos-v2-auth__file{
  display:flex;
  flex-direction:column;
  gap:var(--space-2);
}
#coachos-v2-root .coachos-v2-auth__link{
  align-self:flex-start;
}
#coachos-v2-root .coachos-v2-auth__switch{
  display:flex;
  align-items:center;
  gap:var(--space-2);
  margin-top:var(--space-3);
}
#coachos-v2-root .coachos-v2-stepper{
  list-style:none;
  display:flex;
  gap:var(--space-3);
  padding:0;
  margin:var(--space-2) 0 var(--space-4);
}
#coachos-v2-root .coachos-v2-stepper__item{
  flex:1 1 0;
  display:flex;
  align-items:center;
  gap:var(--space-2);
  color:var(--color-muted);
  font-size:var(--fs-sm);
}
#coachos-v2-root .coachos-v2-stepper__index{
  width:28px;
  height:28px;
  border-radius:var(--radius-pill);
  border:1px solid var(--color-border);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:600;
}
#coachos-v2-root .coachos-v2-stepper__item.is-active{
  color:var(--color-text);
}
#coachos-v2-root .coachos-v2-stepper__item.is-active .coachos-v2-stepper__index{
  border-color:var(--color-primary);
  background:var(--surface-2);
}
#coachos-v2-root .coachos-v2-stepper__item.is-complete{
  color:var(--color-success);
}
#coachos-v2-root .coachos-v2-stepper__item.is-complete .coachos-v2-stepper__index{
  background:var(--color-success);
  border-color:var(--color-success);
  color:#041309;
}

/* ========== 5) THEME: LIGHT (override tokens only) ========== */
#coachos-v2-root.theme-light{
  --color-bg:#f5f7fb;
  --color-panel:#ffffff;
  --color-panel-subtle:#f8f9fb;
  --color-text:#12263f;
  --color-muted:rgba(18,38,63,0.72);
  --color-primary:#1b65d6;
  --color-border:rgba(18,38,63,0.12);
  --radius-sm:6px;
  --radius-md:var(--radius-3); /* 12px */
  --radius-lg:20px;
  --radius-2xl:24px;
  --surface-2:color-mix(in srgb, var(--color-panel) 92%, var(--color-primary) 8%);
  --surface-3:color-mix(in srgb, var(--color-panel-subtle) 80%, var(--color-bg) 20%);
  --shadow-sm:0 8px 18px rgba(18, 38, 63, 0.16);
  --accent:#405ccf;
  --shadow-1: 0 10px 26px rgba(18, 38, 63, 0.08);
  --shadow-2: 0 20px 44px rgba(18, 38, 63, 0.12);
}
@supports (padding: env(safe-area-inset-top)){
  #coachos-v2-root .coachos-v2-app-header{
    padding-top:calc(var(--space-4) + env(safe-area-inset-top));
  }
}
#coachos-v2-root .coachos-v2-chat__composer--coach{
  border-top:none;
}
#coachos-v2-root.theme-light .coachos-v2-chat__composer--coach{
  background:linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);
}
#coachos-v2-root .coachos-v2-dm-msg__text{
  margin-block-end:0;
}
#coachos-v2-root .cohort-index{
  display:flex;
  flex-direction:column;
  gap:var(--space-5);
}
#coachos-v2-root .cohort-index__grid{
  display:grid;
  gap:var(--space-4);
  grid-template-columns:repeat(auto-fill,minmax(220px,1fr));
}
#coachos-v2-root .cohort-index__error{
  display:flex;
  align-items:center;
  gap:var(--space-2);
}
#coachos-v2-root .cohort-index__empty{
  display:flex;
  justify-content:center;
  padding:var(--space-6);
  border:1px dashed var(--color-border);
  border-radius:var(--radius-4);
}
#coachos-v2-root .cohort-index__empty p{ margin:0; }
#coachos-v2-root .cohort-card{
  display:flex;
  flex-direction:column;
  gap:var(--space-3);
  cursor:pointer;
  min-height:220px;
  transition:transform 140ms ease, box-shadow 140ms ease;
}
#coachos-v2-root .cohort-card:hover{
  transform:translateY(-2px);
  box-shadow:var(--shadow-1);
}
#coachos-v2-root .cohort-card:focus{
  outline:none;
}
#coachos-v2-root .cohort-card:focus-visible{
  outline:2px solid var(--color-primary);
  outline-offset:2px;
  box-shadow:var(--shadow-2);
}
#coachos-v2-root .cohort-card__media{
  width:100%;
  height:120px;
  border-radius:var(--radius-md);
  background:color-mix(in oklab, var(--color-panel-subtle) 85%, var(--color-border) 15%);
}
#coachos-v2-root .cohort-card__body{
  display:flex;
  flex-direction:column;
  gap:var(--space-2);
}
#coachos-v2-root .cohort-card__row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:var(--space-2);
}
#coachos-v2-root .cohort-card__meta{
  display:flex;
  flex-wrap:wrap;
  gap:var(--space-2);
}
#coachos-v2-root .cohort-card__role{
  display:inline-flex;
  align-items:center;
  padding:2px 8px;
  border-radius:var(--radius-pill);
  font-size:var(--fs-xs);
  letter-spacing:.08em;
  text-transform:uppercase;
  background:color-mix(in oklab, var(--color-panel-subtle) 80%, var(--color-border) 20%);
  color:var(--color-muted);
}
#coachos-v2-root .cohort-card__badge--unread{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:2px 8px;
  border-radius:var(--radius-pill);
  font-size:var(--fs-xs);
  font-weight:600;
  background:var(--color-primary);
  color:#fff;
}
#coachos-v2-root .cohort-card__chip{
  display:inline-flex;
  align-items:center;
  gap:var(--space-1);
  padding:4px 10px;
  border-radius:var(--radius-pill);
  font-size:var(--fs-xs);
  background:color-mix(in oklab, var(--color-panel-subtle) 70%, var(--color-border) 30%);
  color:var(--color-muted);
}
#coachos-v2-root .cohort-card--skeleton{
  pointer-events:none;
}
#coachos-v2-root .cohort-detail{
  display:flex;
  flex-direction:column;
  gap:var(--space-4);
  position:relative;
}
#coachos-v2-root .cohort-detail__chrome{
  position:sticky;
  top:0;
  z-index:3;
  display:flex;
  flex-direction:column;
  gap:var(--space-3);
  padding-bottom:var(--space-3);
  background:linear-gradient(180deg, var(--color-bg) 65%, rgba(255,255,255,0));
  border-bottom:1px solid var(--color-border);
}
#coachos-v2-root .cohort-detail.coachos-v2-route--padded.cohort-detail--single{
  overflow:auto;
}
#coachos-v2-root .cohort-detail--single .cohort-detail__chrome{
  gap:var(--space-2);
  background:none;
  position:relative;
}
#coachos-v2-root .cohort-detail--single .cohort-detail__chrome::before{
  content:'';
  position:absolute;
  inset:0;
  background:linear-gradient(180deg, var(--color-bg) 65%, rgba(255,255,255,0));
  z-index:-1;
  pointer-events:none;
}
#coachos-v2-root .cohort-detail__header{
  display:flex;
  align-items:flex-start;
  gap:var(--space-3);
}
#coachos-v2-root .cohort-detail__back{
  min-width:0;
  padding-inline:var(--space-2);
}
#coachos-v2-root .cohort-detail__titles{
  display:flex;
  flex-direction:column;
  gap:var(--space-1);
  flex:1 1 auto;
}
#coachos-v2-root .cohort-detail__title{
  margin:0;
}
#coachos-v2-root .cohort-detail__summary{
  margin:0;
}
#coachos-v2-root .cohort-tabs{
  display:flex;
  gap:var(--space-2);
  overflow-x:auto;
  padding-bottom:var(--space-1);
  padding-top:15px;
  padding-left:20px;
  scrollbar-width:none;
}
#coachos-v2-root .cohort-tabs::-webkit-scrollbar{
  display:none;
}
#coachos-v2-root .cohort-tab-btn{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:var(--space-1);
  border:none;
  background:none;
  border-radius:var(--radius-pill);
  padding:calc(var(--space-2) - 2px) var(--space-4);
  font:inherit;
  color:var(--color-muted);
  cursor:pointer;
  transition:color 120ms ease, background 120ms ease;
}
#coachos-v2-root .cohort-tab-btn:hover{
  color:var(--color-text);
  background:rgba(255,255,255,0.04);
}
#coachos-v2-root .cohort-tab-btn:focus{
  outline:none;
}
#coachos-v2-root .cohort-tab-btn:focus-visible{
  outline:2px solid var(--color-primary);
  outline-offset:2px;
}
#coachos-v2-root .cohort-tab-btn--active{
  color:var(--color-text);
  background:rgba(27,101,214,0.12);
}
#coachos-v2-root .cohort-tab-btn--switch[hidden]{
  display:none!important;
}
#coachos-v2-root .cohort-detail__empty{
  margin:var(--space-3) 0;
  display:flex;
  align-items:center;
  gap:var(--space-3);
}
#coachos-v2-root .cohort-detail__empty[hidden]{
  display:none!important;
}
#coachos-v2-root .cohort-detail__empty .cohort-tab-btn{
  padding-inline:var(--space-3);
}
#coachos-v2-root .cohort-tab-panel{
  display:flex;
  flex-direction:column;
  gap:var(--space-3);
  min-height:360px;
}
#coachos-v2-root .cohort-chat-panel{
  background:transparent;
  border:none;
  box-shadow:none;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:0;
  min-height:0;
}
#coachos-v2-root .cohort-chat{
  display:flex;
  flex-direction:column;
  height:100%;
  background:transparent;
}
#coachos-v2-root .cohort-chat__header{
  display:none;
}
#coachos-v2-root.is-cohort-chat .cohort-chat__header{
  display:flex;
  align-items:center;
  gap:var(--space-3);
  padding:var(--space-4) var(--space-6);
  border-bottom:1px solid var(--color-border);
  background:var(--color-panel);
  position:sticky;
  top:0;
  z-index:5;
}
#coachos-v2-root .cohort-chat__back{
  border:none;
  background:transparent;
  color:var(--color-text);
  font-size:var(--fs-sm);
  display:inline-flex;
  align-items:center;
  gap:var(--space-1);
  cursor:pointer;
  padding:var(--space-1) var(--space-2);
}
#coachos-v2-root .cohort-chat__back:hover{
  color:var(--color-primary);
}
#coachos-v2-root .cohort-chat__back:focus-visible{
  outline:2px solid var(--color-primary);
  outline-offset:2px;
}
#coachos-v2-root .cohort-chat__title{
  font-size:var(--fs-lg);
  font-weight:600;
  flex:1 1 auto;
}
#coachos-v2-root .cohort-chat__content{
  flex:1 1 auto;
  display:flex;
  flex-direction:column;
  background:transparent;
  min-height:0;
}
#coachos-v2-root .cohort-chat__content .coachos-v2-dm-thread__scroll{
  flex:1 1 auto;
  min-height:0;
}
#coachos-v2-root .cohort-tab-panel[data-panel="chat"]{
  background:transparent;
  border:none;
  box-shadow:none;
  padding:0;
}
#coachos-v2-root .cohort-tab-panel[data-panel="chat"] > .cohort-chat{
  padding:0;
  background:transparent;
  border:none;
  box-shadow:none;
}
#coachos-v2-root .cohort-tab-panel[data-panel="chat"] .coachos-v2-dm-thread__scroll{
  padding:0;
}
#coachos-v2-root .cohort-tab-panels{
  display:flex;
  flex-direction:column;
  gap:var(--space-4);
}
#coachos-v2-root .cohort-switch-sheet{
  position:fixed;
  inset:0;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  padding:var(--space-6) var(--space-4);
  background:rgba(13,16,24,0.65);
  backdrop-filter:blur(2px);
  z-index:1000;
}
#coachos-v2-root .cohort-switch-sheet[hidden]{
  display:none!important;
}
#coachos-v2-root .cohort-switch-sheet__backdrop{
  position:absolute;
  inset:0;
}
#coachos-v2-root .cohort-switch-sheet__dialog{
  position:relative;
  width:min(720px,100%);
  background:var(--color-panel);
  border-radius:var(--radius-4) var(--radius-4) 0 0;
  box-shadow:var(--shadow-2);
  padding:var(--space-5);
  max-height:70vh;
  overflow:auto;
}
#coachos-v2-root .cohort-switch-sheet__header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:var(--space-2);
  margin-bottom:var(--space-3);
}
#coachos-v2-root .cohort-switch-sheet__close{
  border:none;
  background:none;
  color:var(--color-muted);
  font-size:1.25rem;
  line-height:1;
  cursor:pointer;
  padding:var(--space-1);
}
#coachos-v2-root .cohort-switch-sheet__close:hover{
  color:var(--color-text);
}
#coachos-v2-root .cohort-switch-sheet__body{
  display:flex;
  flex-direction:column;
  gap:var(--space-3);
  overflow:auto;
}
#coachos-v2-root .cohort-switch-sheet__body .cohort-index__grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:var(--space-3);
}
@media (min-width: 1200px){
  #coachos-v2-root .cohort-switch-sheet{
    position:fixed;
    inset:var(--pane-gutter);
    padding:0;
    background:transparent;
    backdrop-filter:none;
    align-items:stretch;
    justify-content:flex-end;
    pointer-events:none;
  }
  #coachos-v2-root .cohort-switch-sheet__dialog{
    width:var(--context-w);
    max-width:var(--context-w);
    border-radius:var(--radius-lg);
    height:100%;
    max-height:none;
    overflow:auto;
    pointer-events:auto;
  }
  #coachos-v2-root .cohort-switch-sheet__backdrop{
    display:none;
  }
}
#coachos-v2-root.is-cohort-chat .coachos-v2-app-header{
  display:none;
}
#coachos-v2-root.is-cohort-chat .coachos-v2-stage{
  padding-top:0;
}
#coachos-v2-root.is-cohort-chat .cohort-detail__chrome{
  display:none;
}
#coachos-v2-root.is-cohort-chat .cohort-detail.coachos-v2-route--padded{
  padding:0;
  gap:0;
}
#coachos-v2-root.is-cohort-chat .cohort-detail{
  flex:1 1 auto;
  min-height:100dvh;
  height:100dvh;
  overflow:hidden;
}
#coachos-v2-root.is-cohort-chat .cohort-tab-panels{
  flex:1 1 auto;
  display:flex;
  gap:0;
}
#coachos-v2-root.is-cohort-chat .cohort-chat-panel{
  flex:1 1 auto;
}
#coachos-v2-root.is-cohort-chat .cohort-chat-panel .cohort-chat__header{
  background:var(--color-panel);
}
#coachos-v2-root.is-cohort-chat .cohort-chat-panel .cohort-chat__content{
  flex:1 1 auto;
}
#coachos-v2-root.is-cohort-chat .cohort-chat-panel .coachos-v2-dm-thread__scroll{
  padding:var(--space-4) var(--space-6);
  padding-bottom:calc(var(--space-4) + 72px);
}
#coachos-v2-root.is-cohort-chat .cohort-chat-panel .coachos-v2-dm-composer{
  padding:var(--space-3) var(--space-6);
  border-top:1px solid var(--color-border);
  background:var(--color-panel);
  position:sticky;
  bottom:0;
}
#coachos-v2-root .cohort-overview{
  display:grid;
  gap:var(--space-4);
}
#coachos-v2-root .cohort-overview__cards{
  display:grid;
  gap:var(--space-4);
}
#coachos-v2-root .cohort-overview__block{
  display:flex;
  flex-direction:column;
  gap:var(--space-2);
}
#coachos-v2-root .cohort-overview__list{
  display:flex;
  flex-wrap:wrap;
  gap:var(--space-2);
}
#coachos-v2-root .overview-preview__row{
  display:flex;
  align-items:flex-start;
  gap:var(--space-3);
}
#coachos-v2-root .overview-preview__row + .overview-preview__row{
  margin-top:var(--space-5);
}
#coachos-v2-root .overview-preview__avatar{
  width:55px;
  height:55px;
  border-radius:50%;
  overflow:hidden;
  flex:0 0 55px;
}
#coachos-v2-root .overview-preview__avatar .coachos-v2-avatar-button{
  width:100%;
  height:100%;
  border-radius:50%;
  padding:0;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  background:transparent;
  border:none;
}
#coachos-v2-root .overview-preview__avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
  border-radius:50%;
  display:block;
}
#coachos-v2-root .overview-preview__avatar .coachos-v2-avatar-initials{
  width:100%;
  height:100%;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:1rem;
}
#coachos-v2-root .overview-preview__message{
  flex:1 1 auto;
  display:flex;
  flex-direction:column;
  gap:4px;
  min-width:0;
}
#coachos-v2-root .overview-preview__meta{
  display:flex;
  align-items:baseline;
  gap:var(--space-2);
}
#coachos-v2-root .overview-preview__author{
  font-weight:600;
  color:var(--color-text);
}
#coachos-v2-root .overview-preview__ago{
  font-size:var(--fs-xs);
  color:var(--color-muted);
}
#coachos-v2-root .overview-preview__body{
  margin:0;
  color:var(--color-text);
  word-break:break-word;
  font-size:var(--fs-sm);
}
#coachos-v2-root .overview-card__header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:var(--space-3);
  min-height:44px;
}
#coachos-v2-root .overview-card__header--preview .coachos-v2-header,
#coachos-v2-root .overview-card__header--calls .coachos-v2-header{
  margin-bottom:0;
}
#coachos-v2-root [data-overview-card="preview"] .overview-card__body{
  margin-top:20px;
}
#coachos-v2-root [data-overview-card="calls"] .overview-card__body{
  margin-top:5px;
}
#coachos-v2-root .overview-preview__action{
  margin-left:auto;
  border:1px solid color-mix(in oklab, var(--color-border) 80%, transparent 20%);
  color:var(--color-text);
  background:color-mix(in oklab, var(--color-panel) 85%, transparent 15%);
}
#coachos-v2-root .overview-call__title{
  margin:0;
  font-size:var(--fs-base);
  color:var(--color-text);
}
#coachos-v2-root .overview-call__title strong{
  font-size:var(--fs-lg);
}
#coachos-v2-root .overview-call__meta{
  display:flex;
  flex-wrap:wrap;
  gap:var(--space-2);
  margin-top:var(--space-1);
  color:var(--color-muted);
  font-size:var(--fs-sm);
}
#coachos-v2-root .overview-call__meta span{
  display:flex;
  align-items:center;
  gap:4px;
}
#coachos-v2-root .program-live-card__label{
  margin:0;
  font-size:var(--fs-xs);
  letter-spacing:.04em;
}
#coachos-v2-root .overview-call__badge{
  padding:2px 10px;
  border-radius:var(--radius-pill);
  font-size:var(--fs-xs);
  text-transform:uppercase;
  letter-spacing:.06em;
  background:color-mix(in oklab, var(--color-success) 20%, var(--color-panel) 80%);
  color:var(--color-success);
}
#coachos-v2-root .overview-call__actions{
  display:flex;
  gap:var(--space-3);
  margin-top:var(--space-3);
  flex-wrap:wrap;
}
#coachos-v2-root .live-call-card__row{
  align-items:center;
  gap:var(--space-4);
}
#coachos-v2-root .live-call-card__date{
  width:64px;
  min-width:64px;
  height:64px;
  border-radius:var(--radius-md);
  background:color-mix(in oklab, var(--color-panel) 82%, var(--accent) 7%);
  border:1px solid color-mix(in oklab, var(--color-border) 80%, transparent 20%);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
}
#coachos-v2-root .live-call-card__day{
  font-size:var(--fs-lg);
  font-weight:700;
  line-height:1.1;
}
#coachos-v2-root .live-call-card__month{
  font-size:var(--fs-xs);
  letter-spacing:.14em;
  text-transform:uppercase;
  color:var(--color-muted);
}
#coachos-v2-root .live-call-card__content{
  min-width:0;
}
#coachos-v2-root .live-call-card__cta{
  margin-left:auto;
  display:flex;
  align-items:center;
}
#coachos-v2-root .cohort-overview__member{
  display:inline-flex;
  align-items:center;
  gap:var(--space-1);
  padding:4px 10px;
  border-radius:var(--radius-pill);
  font-size:var(--fs-xs);
  background:color-mix(in oklab, var(--color-panel-subtle) 75%, var(--color-border) 25%);
  color:var(--color-text);
}
#coachos-v2-root .cohort-overview__member-name{
  font-weight:600;
}
#coachos-v2-root .cohort-overview__role{
  font-size:11px;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:var(--color-muted);
}
#coachos-v2-root .cohort-overview__member--extra,
#coachos-v2-root .cohort-overview__member--empty{
  background:transparent;
  border:1px dashed var(--color-border);
  color:var(--color-muted);
}

#coachos-v2-root .cohort-tab-panel[data-panel="members"]{
  padding:0;
  gap:var(--space-4);
}
#coachos-v2-root .members-panel{
  display:flex;
  flex-direction:column;
  gap:var(--space-4);
  padding-bottom:var(--space-4);
}
#coachos-v2-root .members-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding-bottom:var(--space-2);
}
#coachos-v2-root .members-search{
  width:100%;
  position:relative;
  padding-left:20px;
  padding-right:20px;
}
#coachos-v2-root .members-search-input{
  width:100%;
  padding:10px var(--space-4);
  border-radius:var(--radius-pill);
  border:1px solid var(--color-border);
  background:color-mix(in oklab, var(--color-panel-subtle) 80%, black 10%);
  color:var(--color-text);
  font-size:var(--fs-md);
  transition:border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
#coachos-v2-root .members-search-input::placeholder{
  color:rgba(232,234,239,0.45);
}
#coachos-v2-root .members-search-input:focus-visible{
  outline:2px solid var(--color-primary);
  outline-offset:2px;
  border-color:var(--color-primary);
  box-shadow:0 0 0 4px rgba(98,162,255,0.12);
}
#coachos-v2-root .members-body{
  display:flex;
  flex-direction:column;
  gap:var(--space-3);
}
#coachos-v2-root .members-list{
  display:flex;
  flex-direction:column;
  gap:var(--space-4);
}
#coachos-v2-root .members-list[data-empty="true"]{
  min-height:0;
}
#coachos-v2-root .members-empty{
  border:1px dashed var(--color-border);
  border-radius:var(--radius-3);
  padding:var(--space-4);
  text-align:center;
  background:color-mix(in oklab, var(--color-panel-subtle) 70%, black 8%);
  margin:0;
}
#coachos-v2-root .member-row{
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:var(--space-4);
  padding:var(--space-4);
  transition:transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}
#coachos-v2-root .member-row:hover,
#coachos-v2-root .member-row:focus-visible{
  transform:translateY(-2px);
  outline:none;
}
#coachos-v2-root .member-row[role="listitem"]{
  cursor:default;
}
#coachos-v2-root .member-row--skeleton{
  pointer-events:none;
  opacity:0.55;
  box-shadow:none;
  border:1px dashed var(--color-border);
}
#coachos-v2-root .member-avatar{
  width:52px;
  height:52px;
  border-radius:50%;
  overflow:hidden;
  background:color-mix(in oklab, var(--color-panel) 80%, var(--color-border) 20%);
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
}
#coachos-v2-root .member-avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
#coachos-v2-root .member-avatar__fallback{
  font-weight:600;
  font-size:var(--fs-lg);
  color:var(--color-text);
  text-transform:uppercase;
}
#coachos-v2-root .member-info{
  display:flex;
  flex-direction:column;
  gap:4px;
  min-width:0;
}
#coachos-v2-root .member-name{
  font-weight:600;
  font-size:var(--fs-md);
  color:var(--color-text);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
#coachos-v2-root .member-joined{
  font-size:var(--fs-sm);
  color:var(--color-muted);
}
#coachos-v2-root .member-action{
  display:flex;
  align-items:center;
  justify-content:flex-end;
}
#coachos-v2-root .member-message-btn{
  padding:8px 16px;
  border-radius:var(--radius-pill);
  border:1px solid var(--color-border);
  background:color-mix(in oklab, var(--color-panel-subtle) 75%, black 8%);
  color:var(--color-text);
  font-size:var(--fs-sm);
  font-weight:600;
  cursor:pointer;
  transition:background var(--dur-2) var(--ease), transform var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease);
}
#coachos-v2-root .member-message-btn:hover:not(:disabled){
  background:var(--color-primary);
  border-color:var(--color-primary);
  transform:translateY(-1px);
  color:#fff;
}
#coachos-v2-root .member-message-btn:focus-visible{
  outline:2px solid var(--color-primary);
  outline-offset:2px;
}
#coachos-v2-root .member-message-btn:disabled{
  opacity:0.6;
  cursor:not-allowed;
  transform:none;
}
#coachos-v2-root .member-message-btn--self{
  background:transparent;
  border:1px dashed var(--color-border);
  color:var(--color-muted);
  cursor:default;
}
#coachos-v2-root .member-message-btn.is-loading{
  cursor:wait;
}
#coachos-v2-root .member-message-btn.is-loading::after{
  content:'…';
  margin-left:6px;
}
#coachos-v2-root .cohort-retry{
  border:none;
  cursor:pointer;
  background:color-mix(in oklab, var(--color-panel-subtle) 70%, var(--color-border) 30%);
  color:var(--color-text);
}
#coachos-v2-root .cohort-retry:hover{
  background:color-mix(in oklab, var(--color-panel-subtle) 60%, var(--color-border) 40%);
}
#coachos-v2-root .cohort-skeleton{
  position:relative;
  overflow:hidden;
  border-radius:var(--radius-sm);
  background:linear-gradient(90deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.08) 100%);
  background-size:200% 100%;
  animation:cohort-shimmer 1.4s linear infinite;
}
#coachos-v2-root .cohort-skeleton--text{
  height:0.8rem;
  max-width:80%;
}
#coachos-v2-root .cohort-skeleton-block{
  height:140px;
  border-radius:var(--radius-lg);
  background:linear-gradient(90deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.18) 50%, rgba(255,255,255,0.08) 100%);
  background-size:200% 100%;
  animation:cohort-shimmer 1.4s linear infinite;
}
#coachos-v2-root .cohort-skeleton-block--wide{
  height:220px;
}
#coachos-v2-root .cohort-skeleton-block--narrow{
  height:80px;
}
@keyframes cohort-shimmer{
  0%{ background-position:-120% 0; }
  100%{ background-position:120% 0; }
}

/* ===== Full Screen Route ===== */
#coachos-v2-root .fs-route{
  flex:1 1 auto;
  display:flex;
  flex-direction:column;
  width:100%;
  background:var(--color-bg);
  min-height:100vh;
  min-height:100svh;
  height:100vh;
  height:100dvh;
  overscroll-behavior:contain;
}
#coachos-v2-root .fs-route.fs-route--with-header{
  padding-top:var(--header-h,56px);
}
#coachos-v2-root .fs-route.fs-route--no-header{
  padding-top:0;
  padding-top:env(safe-area-inset-top);
}
#coachos-v2-root .fs-route.fs-route--slide{
  animation:fs-enter var(--dur-2) var(--ease);
}

/* ===== Full Screen Header (in-route) ===== */
#coachos-v2-root .fs-header{
  position:sticky;
  top:0;
  z-index:2;
  display:flex;
  align-items:center;
  gap:var(--fs-gap);
  min-height:var(--fs-header-h);
  background:var(--color-bg);
  border-bottom:1px solid var(--color-border);
  padding:var(--space-3) var(--space-5);
  padding-top:calc(var(--space-3) + env(safe-area-inset-top));
  padding-right:calc(var(--space-5) + env(safe-area-inset-right));
  padding-bottom:var(--space-3);
  padding-left:calc(var(--space-5) + env(safe-area-inset-left));
}
#coachos-v2-root .fs-header__back {
  appearance:none; border:none; background:transparent; cursor:pointer;
  width:40px; height:40px; border-radius:9999px;
  display:inline-flex; align-items:center; justify-content:center;
  transition: background var(--dur-1) var(--ease);
  color:var(--color-text);
}
#coachos-v2-root .fs-header__back svg,
#coachos-v2-root .fs-header__back path,
#coachos-v2-root .fs-header__back span{
  color:inherit;
  fill:currentColor;
}
#coachos-v2-root .fs-header__back:hover,
#coachos-v2-root .fs-header__back:focus-visible { background: rgba(255,255,255,.08); }

#coachos-v2-root .fs-header__meta {
  display:flex; align-items:center; gap: var(--space-3);
  min-width:0; /* text truncation safety */
}
#coachos-v2-root .fs-header__avatar {
  width:32px; height:32px; border-radius:9999px; object-fit:cover; flex:0 0 auto;
}
#coachos-v2-root .fs-header__title {
  font-size: var(--fs-lg); font-weight:600; color:var(--color-text);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}

/* ===== Content / Footer ===== */
#coachos-v2-root .fs-content{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  padding:var(--fs-gap) var(--space-5);
  padding-bottom:40px;
}
#coachos-v2-root .fs-footer{
  position:sticky;
  bottom:0;
  z-index:2;
  flex:0 0 auto;
  width:100%;
  background:var(--color-bg);
  border-top:1px solid var(--color-border);
  padding:var(--space-3) var(--space-5);
  padding-right:calc(var(--space-5) + env(safe-area-inset-right));
  padding-bottom:calc(var(--space-3) + env(safe-area-inset-bottom));
  padding-left:calc(var(--space-5) + env(safe-area-inset-left));
  min-height:var(--fs-footer-h, auto);
}
#coachos-v2-root .fs-route.fs-route--avoid-kb .fs-footer{
  margin-bottom:env(keyboard-inset-height, 0px);
}

@keyframes fs-enter{
  from{ opacity:0; transform:translateY(8px); }
  to{ opacity:1; transform:translateY(0); }
}

/* Design System fullscreen demo container */
#coachos-v2-root .ds-fullscreen-demo{
  border:1px dashed var(--color-border);
  border-radius:var(--radius-4);
  padding:var(--space-4);
  background:color-mix(in oklab, var(--color-panel) 85%, transparent 15%);
}
#coachos-v2-root .ds-fullscreen-demo .fs-route{
  min-height:360px;
  height:auto;
  animation:none;
}
#coachos-v2-root .ds-fullscreen-demo .fs-content{
  max-height:220px;
}
#coachos-v2-root .ds-fullscreen-demo .fs-footer{
  position:static;
  margin-bottom:0;
}

#coachos-v2-root .live-banner{
  position:fixed;
  top:16px;
  left:50%;
  transform:translateX(-50%);
  background:var(--surface-2);
  padding:.5rem 1rem;
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-sm);
  animation:fadeOut 10s forwards;
  z-index:1000;
}

@keyframes fadeOut{
  0%,80%{opacity:1;}
  100%{opacity:0;pointer-events:none;}
}

#coachos-v2-root .live-video{
  position:relative;
  overflow:hidden;
}

#coachos-v2-root .live-video video,
#coachos-v2-root .live-video iframe{
  width:100%;
  border-radius:var(--radius-2xl);
  display:block;
  background:#000;
}

#coachos-v2-root .live-timer{
  font-weight:700;
  font-size:1.75rem;
  margin-top:.5rem;
}

#coachos-v2-root .live-timer--overlay{
  position:absolute;
  right:1rem;
  bottom:1rem;
}

#coachos-v2-root .live-avatars{
  display:flex;
  flex-wrap:wrap;
  gap:var(--space-3);
  margin-top:.5rem;
}

#coachos-v2-root .live-avatar{
  width:64px;
  height:64px;
  border-radius:999px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:var(--surface-3);
  position:relative;
  font-weight:600;
}

#coachos-v2-root .live-avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
  border-radius:inherit;
}

#coachos-v2-root .live-avatar.initials{
  font-weight:700;
  opacity:.9;
}

#coachos-v2-root .live-avatar .ring{
  position:absolute;
  inset:-3px;
  border:2px solid transparent;
  border-radius:inherit;
}

#coachos-v2-root .live-avatar.speaking .ring{
  border-color:var(--accent, var(--color-primary));
}

#coachos-v2-root .live-chip-warn{
  display:inline-block;
  padding:.12rem .5rem;
  border-radius:999px;
  background:var(--surface-3);
  margin-left:.5rem;
  font-size:var(--fs-sm);
}

body.coachos-v2--fs-active #coachos-v2-root .fs-route.fs-route--with-header{
  padding-top:env(safe-area-inset-top);
}
#coachos-v2-root .room-mic-toggle{
  width:56px;
  height:56px;
  border-radius:50%;
  border:none;
  background:transparent;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0;
  box-shadow:none;
}
#coachos-v2-root .room-mic-toggle:disabled{
  opacity:0.5;
}
#coachos-v2-root .room-mic-toggle__circle{
  width:56px;
  height:56px;
  border-radius:50%;
  background:#2e2e2e;
  display:flex;
  align-items:center;
  justify-content:center;
  transition:background-color 0.2s ease;
}
#coachos-v2-root .room-mic-toggle__circle--muted{
  background:#531818;
}
#coachos-v2-root .room-mic-toggle__circle--live{
  background:#1b5e34;
}
#coachos-v2-root .room-mic-toggle__circle img{
  width:26px;
  height:26px;
  opacity:0.95;
}
#coachos-v2-root .room-mic-toggle__circle--muted img{
  filter: invert(36%) sepia(76%) saturate(3338%) hue-rotate(338deg) brightness(101%) contrast(98%);
}
#coachos-v2-root .room-mic-toggle__circle--live img{
  filter: invert(59%) sepia(31%) saturate(731%) hue-rotate(82deg) brightness(95%) contrast(94%);
}
#coachos-v2-root .room-leave-button{
  padding-left:25px;
  padding-right:25px;
}
