/*
 * Path 2 Purpose telehealth prototype.
 * Brand colors and type come from path2purposeca.com (computed styles from the live site).
 * Change the brand values in :root and every screen follows.
 */

:root {
  /* Brand, from path2purposeca.com */
  --brand-gold: #E2B45C;        /* primary color: borders, focus, highlights */
  --brand-gold-btn: #D8A04F;    /* primary button fill */
  --brand-brown: #564026;       /* secondary color: dark surfaces */
  --brand-ink: #5D3E1B;         /* site text on light and input text */
  --brand-ink-deep: #2E1F0C;    /* label on gold buttons (darker than the site's #5D3E1B for contrast) */
  --brand-black: #000000;       /* primary text */
  --brand-white: #FFFFFF;       /* background */

  /* Neutrals and tints built from the brand hues */
  --page: #FBF8F2;
  --surface: #FFFFFF;
  --gold-tint: #FBF3E4;
  --gold-wash: #F6E7C6;
  --line: #E8DCC6;
  --line-strong: #CDB995;
  --muted: #6B5536;             /* secondary text, about 6.6:1 on the page color */
  --placeholder-bg: #F3ECDD;

  /* Safety colors. Not part of the brand; kept distinct on purpose. */
  --crisis: #A8281E;
  --crisis-tint: #FDECEA;
  --crisis-ink: #7A1410;

  /* Dark surfaces: staff sidebar */
  --dark: #564026;
  --dark-deep: #2A1E0E;
  --on-dark: #FFFFFF;
  --on-dark-muted: #E9DCC0;

  --radius: 5px;                /* site default */
  --radius-pill: 25px;          /* site secondary button */
  --radius-input: 15px;         /* site input */

  --font-heading: 'Syne', system-ui, sans-serif;
  --font-body: 'Poppins', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; }

body {
  background: var(--page);
  color: var(--brand-black);
  font: 400 15px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-ink); }
h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
  color: var(--brand-black);
}
p { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { display: block; flex: none; }

:focus-visible { outline: 3px solid var(--brand-gold); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Phone frame ---------- */

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--page);
}

@media (min-width: 600px) {
  body.phone {
    display: flex;
    justify-content: center;
    padding: 32px 16px;
  }
  body.phone .app {
    width: 390px;
    height: 844px;
    min-height: 0;
    border: 1px solid var(--line-strong);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(86, 64, 38, 0.12);
  }
}

.app-header {
  flex: none;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 20px 8px;
}

.app-header--compact {
  align-items: center;
  padding: 14px 16px 10px;
}

.app-main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 16px 16px;
}

.screen-title { font-size: 28px; margin-top: 4px; }
.screen-title--sm { font-size: 22px; margin-top: 0; }

.back {
  flex: none;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--brand-black);
  text-decoration: none;
}

.header-text { flex: 1; min-width: 0; }
.header-text .muted { margin-top: 2px; }

/* ---------- Type and layout helpers ---------- */

.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.card-title { font-size: 18px; }
.card-title--sm { font-size: 16px; }

.muted { color: var(--muted); font-size: 13px; line-height: 1.45; }

.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.between--top { align-items: flex-start; }
.grow { flex: 1 1 140px; }

.card {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.card--flat { padding: 12px 14px; }

.link-cta {
  align-self: flex-start;
  font-weight: 600;
  font-size: 14px;
  color: var(--brand-ink);
  text-decoration: underline;
  text-decoration-color: var(--brand-gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 16px;
  border: 0;
  border-radius: 0;                       /* site primary button is square */
  background: var(--brand-gold-btn);
  color: var(--brand-ink-deep);
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  text-align: center;
  text-decoration: none;
}

.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn--ghost {
  background: var(--surface);
  color: var(--brand-ink);
  border: 1px solid var(--brand-gold);
  border-radius: var(--radius-pill);      /* site secondary button is pill-shaped */
}

.btn--soft {
  background: var(--gold-tint);
  color: var(--brand-ink);
  border-radius: var(--radius-pill);
}

.btn--small { padding: 8px 12px; font-size: 12px; }

.btn--crisis {
  background: var(--surface);
  color: var(--crisis);
  border: 1.5px solid var(--crisis);
  border-radius: var(--radius-pill);
  padding: 9px 12px;
  font-size: 12px;
  line-height: 1;
}

.btn--wide { width: 100%; }

/* ---------- Chips ---------- */

.chip {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  padding: 4px 8px;
  border-radius: var(--radius);
  background: var(--gold-wash);
  color: var(--brand-ink);
  white-space: nowrap;
}

.chip--plain {
  background: var(--surface);
  color: var(--brand-ink);
  border: 1px solid var(--line-strong);
}

.chip--crisis { background: var(--crisis-tint); color: var(--crisis-ink); }
.chip--neutral { background: #EFEAE0; color: #3A2E1C; }

/* ---------- Form controls ---------- */

.field {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--brand-gold);
  border-radius: var(--radius-input);
  background: var(--surface);
  color: var(--brand-ink);
  resize: none;
}

.check {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
}

.check input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--brand-gold-btn);
}

.check-note { display: block; font-size: 12px; color: var(--muted); }

.mood {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.mood button {
  padding: 10px 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--brand-black);
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
}

.mood button[aria-pressed="true"] {
  background: var(--brand-gold-btn);
  border-color: var(--brand-gold-btn);
  color: var(--brand-ink-deep);
}

.segmented { display: flex; gap: 6px; }

.segmented button {
  flex: 1;
  padding: 8px 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--brand-black);
  font-weight: 600;
  font-size: 12px;
  line-height: 1;
}

.segmented button[aria-pressed="true"] {
  background: var(--gold-wash);
  border-color: var(--brand-gold);
  color: var(--brand-ink-deep);
}

.tabs { display: flex; gap: 6px; margin: 12px 16px 0; flex: none; }

.tabs button {
  flex: 1;
  padding: 8px 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--brand-black);
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
}

.tabs button[aria-selected="true"] {
  background: var(--brand-gold-btn);
  border-color: var(--brand-gold-btn);
  color: var(--brand-ink-deep);
}

/* ---------- Progress ---------- */

.bar { height: 8px; border-radius: 999px; background: var(--gold-wash); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--brand-gold); }

.goal { display: flex; flex-direction: column; gap: 6px; }
.goal-top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.goal-top span:last-child { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ---------- Notices ---------- */

.notice {
  flex: none;
  margin: 0 16px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--gold-tint);
  border: 1px solid var(--gold-wash);
  font-size: 12px;
  line-height: 1.45;
  color: var(--brand-ink);
}

.notice--crisis {
  background: var(--crisis-tint);
  border-color: #F3C5BF;
  color: var(--crisis-ink);
}

/* ---------- Group chat ---------- */

.feed {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 16px;
}

.post {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.post--pinned { background: var(--gold-tint); border-color: var(--gold-wash); }

.post-head { display: flex; align-items: center; gap: 8px; }
.post-head .who { flex: 1; min-width: 0; }
.name { font-size: 13px; font-weight: 600; }
.when { font-size: 11px; color: var(--muted); }
.post-body { font-size: 14px; line-height: 1.5; }
.post-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.post-note { font-size: 12px; font-weight: 600; color: var(--muted); }

.avatar {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--gold-wash);
  color: var(--brand-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}

.avatar--lg {
  width: 56px;
  height: 56px;
  font-size: 22px;
  background: var(--brand-brown);
  color: var(--on-dark);
}

.compose {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 16px 18px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.compose-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.compose-foot .muted { font-size: 12px; }

/* ---------- Bottom tab bar ---------- */

.tabbar {
  flex: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 8px 8px 14px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.tabbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 0;
  border-radius: var(--radius);
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
}

.tabbar a[aria-current="page"] {
  background: var(--gold-tint);
  color: var(--brand-ink);
  font-weight: 600;
}

/* ---------- Schedules, sessions, and community ---------- */

.tabs { overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; padding: 8px 12px; white-space: nowrap; }

.day-head {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 6px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.role-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: var(--radius);
  background: var(--brand-brown);
  color: var(--on-dark);
  font-size: 11px;
  font-weight: 600;
  vertical-align: middle;
}

.compose .segmented { flex-wrap: wrap; }

/* ---------- Staff pages on the phone frame ---------- */

.tabbar--five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tabbar--five a { font-size: 10.5px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.day-head-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; }
.day-head-row .day-head { margin-top: 0; }

/* ---------- Community boxes ---------- */

.community-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.community-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 120px;
  padding: 14px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--brand-black);
}

.community-box:hover { border-color: var(--brand-gold); background: var(--gold-tint); }

.community-box__name {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
}

.community-box__note { font-size: 12px; color: var(--muted); line-height: 1.4; }

.community-box__count { margin-top: auto; font-size: 12px; font-weight: 600; color: var(--brand-ink); }

#community-view { display: flex; flex-direction: column; gap: 12px; }
#community-view > [data-back] { align-self: flex-start; }
.community-head { display: flex; flex-direction: column; gap: 4px; }
#community-name:focus { outline: none; }

/* ---------- Video session (light scheme) ---------- */

.room {
  background: var(--page);
  color: var(--brand-black);
}

.room .eyebrow { color: var(--brand-ink); }
.room .muted { color: var(--muted); }
.room .card { background: var(--surface); border-color: var(--line-strong); }
.room .card-title { color: var(--brand-black); }
.room .check-note { color: var(--muted); }
.room .check input { accent-color: var(--brand-gold-btn); }

.room-head {
  flex: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 16px 16px 12px;
}

.room-head .name-line { font-size: 17px; font-weight: 600; margin-top: 2px; }

.stage {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 0 12px;
  border-radius: 14px;
  background: var(--gold-wash);
  border: 1px solid var(--line-strong);
  overflow: hidden;
}

.stage-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stage-label {
  position: absolute;
  left: 12px;
  bottom: 12px;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 8px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  color: var(--brand-black);
}

.self-view {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 108px;
  height: 144px;
  padding: 8px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.self-view .name { color: var(--brand-black); }
.self-view .when { color: var(--muted); }

.room .avatar--lg {
  background: var(--brand-gold-btn);
  color: var(--brand-ink-deep);
}

.controls {
  flex: none;
  display: flex;
  justify-content: space-evenly;
  align-items: flex-start;
  padding: 16px 12px 28px;
}

.round {
  width: 52px;
  height: 52px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--brand-ink);
  display: flex;
  align-items: center;
  justify-content: center;
}

.round--leave { background: var(--crisis); border-color: var(--crisis); color: var(--on-dark); }

/* ---------- Staff console ---------- */

.console {
  display: flex;
  flex-wrap: wrap;
  min-height: 100vh;
  background: var(--page);
}

.console-nav {
  flex: 0 0 240px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 16px;
  background: var(--dark);
  color: var(--on-dark);
}

.console-nav .brand { padding: 0 8px; }
.console-nav .brand p:first-child {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.2;
}
.console-nav .brand p:last-child { font-size: 12px; color: var(--on-dark-muted); margin-top: 2px; }

.console-nav nav { display: flex; flex-direction: column; gap: 2px; }

.console-nav nav a {
  padding: 9px 10px;
  border-radius: var(--radius);
  color: var(--on-dark-muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.console-nav nav a[aria-current="page"] {
  background: var(--brand-gold-btn);
  color: var(--brand-ink-deep);
  font-weight: 600;
}

.console-user {
  margin-top: auto;
  padding: 12px;
  border-radius: 10px;
  background: var(--brand-brown);
  border: 1px solid #6E5530;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.console-user p:last-child { font-size: 12px; color: var(--on-dark-muted); }

.console-main {
  flex: 999 1 560px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px 28px;
}

.console-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.console-head h1 { font-size: 32px; }
.console-head .muted { margin-top: 4px; }

.split {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.split > * { flex: 1 1 360px; min-width: 0; }
.split > .split-wide { flex: 1.6 1 460px; }

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.grid-3 .card { min-width: 0; }
.card--dashed { border-style: dashed; border-color: #B39B73; }

.rules {
  display: flex;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.rules > div {
  flex: 1 1 220px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid var(--line);
}

.rules > div:last-child { border-right: 0; }
.rules p:first-child { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.rules p:last-child { font-size: 13px; line-height: 1.45; }

.panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-width: 0;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.item:first-of-type { border-top: 0; }
.item-main { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.item-main .row { gap: 8px; }
.item-main p { font-size: 14px; font-weight: 600; }
.item-main .muted { font-size: 12px; font-weight: 400; }
.item-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.hidden-preview {
  padding: 6px 8px;
  border-radius: var(--radius);
  border: 1px dashed var(--line-strong);
  background: var(--placeholder-bg);
  font-size: 12px;
  color: var(--muted);
}

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }

th {
  text-align: left;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}

td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }

.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

.risk-low { background: #EFEAE0; color: #3A2E1C; }
.risk-moderate { background: var(--gold-wash); color: var(--brand-ink); }
.risk-elevated { background: var(--crisis-tint); color: var(--crisis-ink); }

.link-inline { font-weight: 600; color: var(--brand-ink); }

/* ---------- Gallery (index.html) ---------- */

.gallery {
  max-width: 1040px;
  margin: 0 auto;
  padding: 48px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.gallery-head h1 { font-size: 40px; margin-top: 6px; }
.gallery-head p { margin-top: 8px; max-width: 60ch; color: var(--muted); }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.gallery-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--brand-black);
  text-decoration: none;
}

.gallery-card:hover { border-color: var(--brand-gold); }
.gallery-card h2 { font-size: 18px; }
.gallery-card p { font-size: 13px; color: var(--muted); line-height: 1.45; }

.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.swatch {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  font-size: 12px;
}

.swatch span:first-child { height: 64px; }
.swatch span:last-child { padding: 8px 10px; color: var(--brand-black); }

/* ---------- Small additions ---------- */

.btn--crisis-dark {
  background: var(--surface);
  color: var(--crisis);
  border-color: var(--crisis);
}

.pre { margin: 12px; flex: none; }

.gallery-grid + .gallery-grid { margin-top: 0; }

/* ---------- Desktop layout (960px and up) ----------
   Same pages, wider screen: the phone frame goes away, the bottom tab bar
   becomes a side menu, and cards spread across the content area. */

@media (min-width: 960px) {
  body.phone {
    display: block;
    padding: 0;
    background: var(--page);
  }

  body.phone .app {
    width: auto;
    height: auto;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  body.phone .app:has(> .tabbar) {
    display: block;
    padding-left: 248px;
  }

  /* Pages without a tab bar (group chat, video room) sit in a centered column. */
  body.phone .app:not(:has(> .tabbar)) > * {
    width: 100%;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
  }

  /* Side menu */
  body.phone .app > .tabbar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 248px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 28px 16px;
    border-top: 0;
    border-right: 1px solid var(--line);
    background: var(--surface);
  }

  body.phone .app > .tabbar::before {
    content: "Path 2 Purpose";
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 600;
    color: var(--brand-ink);
    padding: 0 14px 22px;
  }

  body.phone .tabbar a {
    flex-direction: row;
    gap: 12px;
    padding: 11px 14px;
    font-size: 15px;
  }

  body.phone .tabbar--five a { font-size: 15px; }

  /* Main column */
  body.phone .app:has(> .tabbar) > :not(.tabbar) {
    width: 100%;
    max-width: 1180px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
  }

  body.phone .app > .app-header {
    padding: 36px 40px 8px;
  }

  body.phone .app > .app-header .screen-title { font-size: 36px; }

  body.phone .app > .app-main {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    align-content: start;
    gap: 16px;
    padding: 8px 40px 56px;
    overflow: visible;
    min-height: 0;
  }

  /* Headings, notes and wide blocks take the full width; cards flow into columns. */
  body.phone .app > .app-main > * { grid-column: 1 / -1; }
  body.phone .app > .app-main > .card,
  body.phone .app > .app-main > article.card,
  body.phone .app > .app-main > section.card { grid-column: auto; }
  body.phone .app > .app-main > .stack {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
  }

  body.phone .day-head { margin-top: 18px; }

  /* Community: wider boxes, feed kept at a readable width */
  body.phone .community-grid {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
  }
  body.phone .community-box { min-height: 150px; padding: 18px; }
  body.phone #community-view { max-width: 860px; }

  /* Video room: a larger stage */
  body.phone .room .stage { min-height: 62vh; }
}
