/* Practice Portfolio — shared stylesheet
   Design tokens and both registers: front-door pages and the practice screen. */

/* ---------- Fonts (self-hosted, latin subset) ---------- */

@font-face {
  font-family: "Lora";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/lora-v37-latin-600.woff2") format("woff2");
}
@font-face {
  font-family: "Lora";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/lora-v37-latin-700.woff2") format("woff2");
}
@font-face {
  font-family: "Lora";
  font-style: italic;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/lora-v37-latin-600italic.woff2") format("woff2");
}
@font-face {
  font-family: "Lora";
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/lora-v37-latin-700italic.woff2") format("woff2");
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/source-sans-3-v19-latin-regular.woff2") format("woff2");
}
@font-face {
  font-family: "Source Sans 3";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/source-sans-3-v19-latin-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/source-sans-3-v19-latin-600.woff2") format("woff2");
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/source-sans-3-v19-latin-700.woff2") format("woff2");
}

/* ---------- Tokens ---------- */

:root {
  --deep-blue: #1F4D80;
  --brand-blue: #336699;
  --orange: #E8751A;
  --orange-hover: #c5610f;
  --ink: #1A1A1A;
  --muted: #666666;
  --tint: #F0F5FA;
  --soft-blue: #B8D4F0;
  --border: #E0E0E0;
  --white: #FFFFFF;
  --serif: "Lora", Georgia, serif;
  --sans: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* Fixed top chrome the practice screen subtracts from the viewport:
     Tier 1 global bar (118px) + Tier 2 Practice Portfolio bar (47px).
     Overridden to 149px at <=1040px, where the Tier 1 logo shrinks to 74px. */
  --room-chrome: 165px;
}

/* ---------- Base ---------- */

* { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--deep-blue);
  line-height: 1.2;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

a { color: var(--brand-blue); }
a:hover, a:focus-visible { color: var(--deep-blue); }

img { max-width: 100%; }

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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

.btn {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  padding: 13px 30px;
  border-radius: 4px;
  border: 0;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.btn-primary {
  background: var(--orange);
  color: var(--white);
}
.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--orange-hover);
  color: var(--white);
}

.btn-secondary {
  background: var(--white);
  color: var(--brand-blue);
  border: 2px solid var(--brand-blue);
  padding: 11px 28px;
}
.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: var(--brand-blue);
  color: var(--white);
}

/* ---------- Top bar: Tier 1 global bar (identical across all CharityChannel surfaces) ---------- */
/* Ported verbatim from the framework page (renderFrameworkResponse in the Worker),
   translated onto the app's design tokens. Reproduced, not shared, per the
   hardcode-and-keep-in-sync decision; edits here must be mirrored there. */

.topbar {
  background: var(--brand-blue);
  position: relative;
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 26px;
}

.brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.brand img {
  height: 90px;
  width: auto;
  display: block;
}

.sp { flex: 1; }

.mainnav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.mainnav a {
  color: #eef4fa;
  font-size: 1.05rem;
  line-height: 1.3;
  padding: 10px 13px;
  border-radius: 4px;
  white-space: nowrap;
  text-decoration: none;
  font-weight: 400;
}

.mainnav a:hover {
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
  color: #eef4fa;
}

.mainnav a.subscribe {
  border: 2px solid var(--orange);
  color: var(--orange);
  border-radius: 6px;
  padding: 8px 22px;
  font-weight: 600;
  margin-right: 8px;
}

.mainnav a.subscribe:hover {
  background: var(--orange);
  color: #fff;
}

.mainnav a.parent.current { color: var(--orange); }

.has-sub { position: relative; }

.has-sub .caret {
  font-size: 0.62em;
  opacity: 0.9;
  vertical-align: middle;
}

.has-sub .sub {
  position: absolute;
  left: 0;
  top: 100%;
  background: #12212e;
  min-width: 224px;
  padding: 0;
  display: none;
  z-index: 20;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
}

.has-sub:hover .sub,
.has-sub:focus-within .sub { display: block; }

.has-sub .sub a {
  display: block;
  padding: 13px 20px;
  border-radius: 0;
  font-size: 1rem;
  color: #eef4fa;
}

.has-sub .sub a:hover { background: #1c3346; }

.has-sub .sub a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--orange); }

.menu-btn {
  display: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.55);
  color: #fff;
  border-radius: 5px;
  padding: 8px 13px;
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}

/* ---------- Top bar: Tier 2 Practice Portfolio bar (app pages only) ---------- */

.pp-bar {
  background: var(--tint);
  border-bottom: 1px solid var(--border);
}

.pp-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  min-height: 46px;
  padding: 0 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.pp-bar-label {
  font-family: var(--serif);
  font-weight: 700;
  color: var(--deep-blue);
  font-size: 1.02rem;
  white-space: nowrap;
  text-decoration: none;
}

.pp-bar-label:hover {
  color: var(--deep-blue);
  text-decoration: underline;
}

.pp-bar-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
}

.pp-bar-links a {
  color: var(--brand-blue);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 6px 11px;
  border-radius: 4px;
  white-space: nowrap;
  text-decoration: none;
}

.pp-bar-links a:hover {
  background: rgba(51, 102, 153, 0.1);
  text-decoration: none;
  color: var(--brand-blue);
}

.pp-bar-links a[aria-current="page"] {
  color: var(--deep-blue);
  box-shadow: inset 0 -2px 0 var(--orange);
}

/* Tier 1 responsive: matches the framework page (logo shrinks at 1040, nav
   collapses to the Menu button at 900). The --room-chrome override keeps the
   practice-screen height math correct for the shorter top bar. */
@media (max-width: 1040px) {
  :root { --room-chrome: 149px; }
  .brand img { height: 74px; }
  .mainnav a { font-size: 0.98rem; padding: 9px 10px; }
}

@media (max-width: 900px) {
  .menu-btn { display: block; margin-left: auto; }

  .mainnav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--brand-blue);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 14px 16px;
    z-index: 30;
  }

  .mainnav.is-open { display: flex; }
  .mainnav a { padding: 12px 10px; }
  .mainnav a.subscribe { margin: 6px 0; text-align: center; }

  .has-sub .sub {
    position: static;
    display: block;
    background: transparent;
    box-shadow: none;
    padding: 0 0 0 14px;
    min-width: 0;
  }

  .has-sub .caret { display: none; }
}

/* Tier 2 responsive: stack the label above the links on narrow phones. */
@media (max-width: 560px) {
  .pp-bar-inner {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
    min-height: 0;
    padding: 8px 16px;
  }
}

/* ---------- Footer (unified across all CharityChannel surfaces) ---------- */
/* Ported from the framework page; two book links added per the unified-footer
   decision. Reproduced, not shared; mirror any change in the Worker footer. */

.site-footer { margin-top: auto; }

.foot-nav {
  background: var(--brand-blue);
  text-align: center;
  padding: 24px 22px;
}

.foot-nav a {
  color: #fff;
  margin: 0 16px;
  font-size: 0.98rem;
  line-height: 2.1;
  white-space: nowrap;
  text-decoration: none;
}

.foot-nav a:hover {
  text-decoration: underline;
  color: #fff;
}

.foot-copy {
  background: #111;
  text-align: center;
  padding: 20px 22px;
}

.foot-copy p {
  color: #d2d8de;
  font-size: 1.05rem;
  margin: 0;
}

@media (max-width: 600px) {
  .foot-nav a { display: inline-block; margin: 4px 12px; }
}

/* ---------- Front-door register ---------- */

.front-door section {
  padding: 60px 24px;
}

.front-door .section-tint { background: var(--tint); }
.front-door .section-white { background: var(--white); }

.section-inner {
  max-width: 1040px;
  margin: 0 auto;
}

.section-prose {
  max-width: 780px;
  margin: 0 auto;
}

.front-door h1 {
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.front-door h2 {
  font-size: 34px;
  font-weight: 700;
  margin-bottom: 20px;
}

.front-door h3 {
  font-size: 21px;
  font-weight: 600;
  margin-bottom: 10px;
}

.subtitle {
  font-size: 24px;
  line-height: 1.45;
  color: var(--ink);
  text-wrap: balance;
}

.small-print {
  font-size: 14.5px;
  color: var(--muted);
}

.kicker {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--brand-blue);
  margin-bottom: 14px;
}

/* Hero */

.hero {
  text-align: center;
  border-bottom: 1px solid var(--border);
  padding-top: 68px;
  padding-bottom: 64px;
}

.hero .subtitle {
  max-width: 780px;
  margin: 0 auto;
}

/* World cards */

.section-heading,
.text-center {
  text-align: center;
}

.section-subtitle {
  text-align: center;
  max-width: 780px;
  margin: -6px auto 0;
  font-size: 19px;
  text-wrap: balance;
}

.world-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 36px;
}

.world-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.world-card-header {
  padding: 26px 32px;
}

.world-card-header .kicker {
  color: var(--soft-blue);
  font-size: 13px;
  letter-spacing: 1.2px;
  margin-bottom: 8px;
}

.world-card-header h3 {
  color: var(--white);
  font-size: 28px;
  font-weight: 600;
  margin: 0;
}

.world-card-header-deep { background: var(--deep-blue); }
.world-card-header-brand { background: var(--brand-blue); }

.world-card-body {
  padding: 28px 32px 32px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.world-card-body p {
  flex: 1;
  margin-bottom: 24px;
}

.world-card-body .btn { align-self: flex-start; }

/* Three steps */

.step-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 40px;
}

.step-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 32px;
}

.step-card .step-number {
  font-family: var(--serif);
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
  color: var(--orange);
  margin: 0 0 12px;
}

.step-card p { margin: 0; font-size: 16px; }

/* Coach cards */

.coach-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 40px;
  margin-bottom: 40px;
}

.coach-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 30px;
}

.coach-card h3 {
  font-size: 20px;
  margin: 0 0 12px;
}

.coach-card p { margin: 0; font-size: 16px; }

.coach-card-dark {
  background: var(--deep-blue);
  border-color: var(--deep-blue);
}

.coach-card-dark h3,
.coach-card-dark p {
  color: var(--white);
}

.framework-link {
  display: inline-block;
  color: var(--brand-blue);
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  border-bottom: 2px solid var(--orange);
  padding-bottom: 2px;
}

.framework-link:hover,
.framework-link:focus-visible {
  color: var(--deep-blue);
}

/* Book duo */

.book-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  max-width: 940px;
  margin: 40px auto 0;
  text-align: left;
}

.book-duo-item {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.book-duo-item > a {
  flex: none;
}

.book-duo-cover {
  display: block;
  height: 210px;
  width: auto;
  max-width: none;
  box-shadow: 0 8px 22px rgba(31, 77, 128, 0.28);
  border-radius: 3px;
}

.book-duo-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.book-duo-text h3 {
  font-size: 20px;
  margin-bottom: 2px;
}

.book-duo-byline {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 12px;
}

.book-duo-text p {
  font-size: 15px;
  margin-bottom: 16px;
}

.book-duo-text .btn {
  font-size: 14.5px;
  padding: 10px 24px;
}

.book-duo-text .small-print { margin: 12px 0 0; }

/* World-page call to action */

.world-cta {
  margin-top: 36px;
}

.btn-large {
  font-size: 19px;
  padding: 17px 44px;
}

.world-cta .small-print {
  margin: 16px 0 0;
}

/* Orientation article */

.orientation-section .section-prose h2 { margin-bottom: 16px; }

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 8px;
}

/* Front-door responsive */

@media (max-width: 960px) {
  .front-door section { padding: 44px 20px; }
  .front-door h1 { font-size: 34px; }
  .front-door h2 { font-size: 28px; }
  .subtitle { font-size: 20px; }

  .world-cards,
  .step-cards,
  .coach-cards,
  .book-duo {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 560px) {
  .book-duo-item { flex-direction: column; }
  .book-duo-item > a { align-self: center; }
  .book-duo-text .btn { align-self: center; }

  /* At phone widths the subtitle exceeds text-wrap: balance's six-line
     limit and balance silently switches off; pretty still prevents a
     single stranded word. */
  .subtitle { text-wrap: pretty; }
}

/* ---------- Practice screen (compact application register) ---------- */

/* The layout fills the viewport below the two-tier top bar (Tier 1 global bar
   + Tier 2 Practice Portfolio bar = --room-chrome); the footer sits after it in
   normal flow, below the fold. */
.practice-main {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 320px;
  /* One row pinned to the container so long content scrolls inside the
     columns instead of growing the page under the footer. */
  grid-template-rows: 100%;
  height: calc(100vh - var(--room-chrome));
  height: calc(100dvh - var(--room-chrome));
  border-bottom: 1px solid var(--border);
}

.practice-page {
  min-height: 100vh;
}

.practice-rail {
  background: var(--tint);
  border-right: 1px solid var(--border);
  padding: 20px 16px;
  overflow-y: auto;
}

.practice-rail h2 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 12px;
}

.practice-roster {
  list-style: none;
  margin: 0;
  padding: 0;
}

.practice-roster li {
  border-radius: 4px;
  color: var(--ink);
}

.practice-roster li:nth-child(odd) { background: rgba(255, 255, 255, 0.7); }

.roster-button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 4px;
  font-family: var(--sans);
  padding: 9px 10px;
  cursor: pointer;
  color: var(--ink);
}

.roster-button strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
}

.roster-button span {
  display: block;
  font-size: 13px;
  color: var(--muted);
}

.roster-button:hover,
.roster-button:focus-visible {
  background: var(--soft-blue);
}

.roster-button.is-selected {
  background: var(--brand-blue);
  color: var(--white);
}

.roster-button.is-selected span { color: var(--soft-blue); }

.practice-conversation {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--white);
}

.practice-conversation-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 32px 28px;
}

.conversation-header {
  padding: 14px 28px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  /* The first-run nudge overflows below the header; lift it over the
     conversation scroll that follows. */
  position: relative;
  z-index: 5;
}

.new-week-button,
.getting-around-button {
  background: transparent;
  border: 0;
  color: var(--brand-blue);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  padding: 4px 2px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.new-week-button:hover,
.new-week-button:focus-visible,
.getting-around-button:hover,
.getting-around-button:focus-visible {
  color: var(--deep-blue);
}

.new-week-confirm {
  border-bottom: 1px solid var(--border);
  background: var(--tint);
  padding: 16px 28px;
}

.new-week-confirm p {
  max-width: 640px;
  font-size: 15.5px;
  margin-bottom: 12px;
}

.new-week-confirm-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.new-week-confirm-buttons .btn {
  font-size: 14.5px;
  padding: 8px 18px;
}

.conversation-header .kicker {
  font-size: 12px;
  letter-spacing: 1.2px;
  margin-bottom: 2px;
}

.conversation-header h1 {
  font-size: 22px;
  font-weight: 600;
  margin: 0;
}

/* The conversation itself: coach messages left-styled prose, reader
   messages a distinct tinted bubble at the right. */

.conversation-messages {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.msg {
  max-width: 85%;
  font-size: 16px;
}

.msg-coach {
  align-self: flex-start;
  border-left: 3px solid var(--soft-blue);
  padding-left: 16px;
}

.msg-coach > :last-child { margin-bottom: 0; }

.msg-coach h3,
.msg-coach h4,
.msg-coach h5 {
  font-family: var(--serif);
  color: var(--deep-blue);
  margin: 0.9em 0 0.35em;
}

.msg-coach > h3:first-child,
.msg-coach > h4:first-child,
.msg-coach > h5:first-child { margin-top: 0; }

.msg-coach h3 { font-size: 18px; }
.msg-coach h4 { font-size: 16.5px; }
.msg-coach h5 { font-size: 15.5px; }

.msg-coach p { margin: 0 0 0.8em; }

.msg-coach ul {
  margin: 0 0 0.8em;
  padding-left: 22px;
}

.msg-coach li { margin-bottom: 0.3em; }

.msg-reader {
  align-self: flex-end;
  background: var(--tint);
  border: 1px solid var(--border);
  border-radius: 10px 10px 2px 10px;
  padding: 10px 16px;
  white-space: pre-wrap;
}

.thinking-line {
  margin: 4px 0 0;
  font-size: 18px;
}

.thinking-line.is-active {
  color: var(--orange);
  font-weight: 600;
  animation: thinking-pulse 1.6s ease-in-out infinite;
}

/* Trailing ellipsis builds dot by dot; the clipped run of periods steps
   through 0–3 visible dots each cycle. */
.thinking-line.is-active::after {
  content: "...";
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  width: 1em;
  animation: thinking-dots 1.6s steps(4, jump-none) infinite;
}

@keyframes thinking-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

@keyframes thinking-dots {
  0% { width: 0; }
  100% { width: 1em; }
}

@media (prefers-reduced-motion: reduce) {
  .thinking-line.is-active { animation: none; }
  .thinking-line.is-active::after {
    animation: none;
    width: auto;
    content: "…";
  }
}

.conversation-notice {
  margin: 16px 0 0;
  max-width: 640px;
  font-size: 15.5px;
  background: var(--tint);
  border: 1px solid var(--soft-blue);
  border-radius: 4px;
  padding: 12px 16px;
}

.prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 28px 14px;
}

/* display: flex on the class outweighs the browser's [hidden] rule. */
.prompt-chips[hidden] { display: none; }

.prompt-chip {
  background: var(--white);
  border: 1px solid var(--brand-blue);
  color: var(--brand-blue);
  font-family: var(--sans);
  font-size: 14.5px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
}

.prompt-chip:hover,
.prompt-chip:focus-visible {
  background: var(--brand-blue);
  color: var(--white);
}

.practice-composer {
  border-top: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  gap: 10px;
  background: var(--white);
}

.practice-composer textarea {
  flex: 1;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--white);
  color: var(--ink);
  resize: none;
  overflow-y: auto;
  min-height: 42px;
}

.practice-composer textarea:disabled {
  background: var(--tint);
  color: var(--muted);
}

.practice-composer .btn { align-self: flex-end; }

.practice-composer .btn {
  font-size: 15px;
  padding: 10px 22px;
}

.practice-composer .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.practice-record {
  background: var(--white);
  border-left: 1px solid var(--border);
  padding: 20px;
  overflow-y: auto;
}

.practice-record h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.sample-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--tint);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 2px 8px;
  margin-bottom: 14px;
}

.practice-record h3 {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--brand-blue);
  margin: 18px 0 6px;
}

.practice-record ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 14.5px;
}

.practice-record ul li {
  padding: 4px 0;
  border-bottom: 1px solid var(--tint);
}

.practice-record p { font-size: 14.5px; margin-bottom: 8px; }

.record-descriptor {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 6px;
}

.record-lede {
  font-size: 14.5px;
  margin: 0 0 12px;
}

.msg-coach .donor-link {
  font-weight: 600;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.officer-note-byline-line {
  margin: 14px 0 0;
}

.officer-note-byline-line + p {
  margin-top: 6px;
}

.record-timestamp { color: var(--muted); }

/* Reader-authored notes and edits */

.record-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 4px 0 10px;
}

.record-actions .btn,
.record-form-buttons .btn {
  font-size: 13.5px;
  padding: 6px 14px;
}

.record-note-form,
.record-name-form {
  margin-top: 16px;
}

.record-note-form textarea,
.record-edit-form textarea,
.record-name-form input {
  display: block;
  width: 100%;
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.45;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--white);
  color: var(--ink);
  resize: vertical;
}

.record-form-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.record-field-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--brand-blue);
  margin: 18px 0 0;
}

.record-field-label textarea {
  margin-top: 6px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
}

.record-name-form input {
  margin-top: 6px;
}

.record-help {
  color: var(--muted);
  font-size: 13.5px;
  margin: 6px 0 0;
}

/* Practice toggles (hidden on wide screens) */

.practice-toggles {
  display: none;
  gap: 10px;
  padding: 10px 16px;
  background: var(--tint);
  border-bottom: 1px solid var(--border);
}

.practice-toggle {
  background: var(--white);
  border: 1px solid var(--brand-blue);
  color: var(--brand-blue);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 4px;
  cursor: pointer;
}

.practice-toggle:hover,
.practice-toggle:focus-visible {
  background: var(--brand-blue);
  color: var(--white);
}

.record-close {
  display: none;
  background: transparent;
  border: 0;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  float: right;
  padding: 4px 8px;
}

@media (max-width: 960px) {
  .practice-page { height: auto; }

  .practice-toggles { display: flex; }

  .practice-main {
    display: block;
    position: relative;
    height: auto;
  }

  .practice-rail {
    display: none;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .practice-rail.is-open { display: block; }

  .practice-conversation { min-height: 60vh; }

  .practice-record {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 20;
    border-left: 0;
    padding: 24px 20px;
    overflow-y: auto;
    box-shadow: 0 0 0 100vmax rgba(26, 26, 26, 0.4);
  }

  .practice-record.is-open { display: block; }

  .record-close { display: block; }
}

/* ---------- In-app help layer (Getting around, record tooltip, review) ---------- */

/* Getting around sits beside Start a new week at the same quiet weight; the
   first-run nudge is anchored to the Getting around control. */
.conversation-header-actions {
  display: flex;
  align-items: flex-end;
  gap: 18px;
}

.getting-around-anchor {
  position: relative;
  display: inline-flex;
}

.help-nudge {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 15;
  width: 240px;
  max-width: min(240px, 74vw);
  background: var(--deep-blue);
  color: var(--white);
  border-radius: 6px;
  padding: 12px 14px;
  box-shadow: 0 6px 18px rgba(31, 77, 128, 0.28);
}

.help-nudge::before {
  content: "";
  position: absolute;
  top: -7px;
  right: 16px;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 7px solid var(--deep-blue);
}

.help-nudge-text {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--white);
}

.help-nudge-dismiss {
  background: var(--white);
  color: var(--deep-blue);
  border: 0;
  border-radius: 4px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 13px;
  padding: 5px 14px;
  cursor: pointer;
}

.help-nudge-dismiss:hover,
.help-nudge-dismiss:focus-visible {
  background: var(--soft-blue);
  color: var(--deep-blue);
}

/* Getting around panel: a centered modal dialog over a dimmed backdrop. */
.help-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(26, 26, 26, 0.5);
}

/* display: flex on the class outweighs the browser's [hidden] rule. */
.help-overlay[hidden] { display: none; }

.help-dialog {
  background: var(--white);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(26, 26, 26, 0.35);
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  padding: 28px 30px 24px;
}

/* Focus is moved here on open for screen readers; suppress the box on this
   programmatic focus (keyboard focus of controls inside keeps its ring). */
.help-dialog:focus { outline: none; }

.help-dialog-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 14px;
}

.help-dialog-body p {
  font-size: 15.5px;
  line-height: 1.6;
  margin: 0 0 14px;
}

.help-dialog-body p:last-child { margin-bottom: 0; }

.help-dialog-link {
  font-weight: 600;
  text-underline-offset: 2px;
}

.help-dialog-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 22px;
}

.help-dialog-actions .btn {
  font-size: 14.5px;
  padding: 10px 24px;
}

/* Email gate (Stage 8): the front-door modal, same treatment as the Getting
   around panel above (centered dialog over a dimmed backdrop) so the two
   modal patterns on the site stay visually consistent. Reader-facing copy
   is five-pass audited; see the vault Draft/Notes pair, "Stage 8 Gate Modal
   and Confirmation Copy." */
.gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(26, 26, 26, 0.5);
}

.gate-overlay[hidden] { display: none; }

.gate-dialog {
  position: relative;
  background: var(--white);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(26, 26, 26, 0.35);
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  padding: 28px 30px 24px;
}

.gate-dialog:focus { outline: none; }

.gate-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: transparent;
  border: 0;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
}

.gate-close:hover,
.gate-close:focus-visible {
  color: var(--deep-blue);
}

.gate-dialog-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 26px 14px 0;
}

.gate-dialog-intro {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  margin: 0 0 6px;
}

.gate-form .record-field-label:first-of-type {
  margin-top: 18px;
}

.gate-form input {
  display: block;
  width: 100%;
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.45;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--white);
  color: var(--ink);
  margin-top: 6px;
}

.gate-turnstile {
  margin: 18px 0 4px;
}

.gate-dialog-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.gate-error,
.gate-success {
  font-size: 15px;
  line-height: 1.55;
  margin: 0 0 14px;
  background: var(--tint);
  border: 1px solid var(--soft-blue);
  border-radius: 4px;
  padding: 10px 14px;
}

/* Record panel: the ? help affordance and its tooltip. */
.record-topbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 22px;
  margin-bottom: 2px;
}

.record-help-affordance {
  position: relative;
  display: inline-flex;
}

.record-help-toggle {
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--brand-blue);
  background: var(--white);
  color: var(--brand-blue);
  font-family: var(--sans);
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.record-help-toggle:hover,
.record-help-toggle:focus-visible {
  background: var(--brand-blue);
  color: var(--white);
}

.record-help-tip {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 15;
  width: 220px;
  background: var(--deep-blue);
  color: var(--white);
  font-size: 13.5px;
  line-height: 1.45;
  border-radius: 6px;
  padding: 10px 12px;
  box-shadow: 0 6px 18px rgba(31, 77, 128, 0.28);
}

.record-help-tip::before {
  content: "";
  position: absolute;
  top: -7px;
  right: 6px;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 7px solid var(--deep-blue);
}

.record-help-affordance:hover .record-help-tip,
.record-help-toggle:focus-visible + .record-help-tip,
.record-help-affordance.is-open .record-help-tip {
  display: block;
}

/* Review lead-in, shown above the opening prompt chips. */
.review-helper {
  margin: 4px 28px 12px;
  max-width: 640px;
  font-size: 14.5px;
  color: var(--muted);
}

/* ---------- Phone-width tightening (Stage 7 responsive pass) ---------- */

@media (max-width: 480px) {
  /* Stack the conversation header on a narrow phone: world title on its own
     line, the Getting around and Start a new week controls beneath, so the
     row cannot crowd or push a sliver of horizontal scroll. */
  .conversation-header {
    flex-wrap: wrap;
    gap: 4px 16px;
    padding: 12px 16px 10px;
  }

  .conversation-header-actions {
    flex-basis: 100%;
    justify-content: flex-start;
    gap: 16px;
  }

  /* A little more reading width for the conversation on a narrow screen. */
  .practice-conversation-scroll { padding: 20px 16px; }
  .new-week-confirm { padding: 14px 16px; }
}
