html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

:root {
  --ink: #1f2a1f;
  --gold: #f0c54a;
  --gold-soft: #fff6c7;
  --leaf: #dff4d8;
  --leaf-line: #9fd28f;
  --paper: rgba(255,255,255,0.9);
  --shadow: 0 20px 45px rgba(120, 104, 34, 0.08);
}

body {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #fffbe8 0%, #f6fbff 55%, #eef7f0 100%);
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.app-shell {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
  background: rgba(255, 252, 235, 0.84);
  border-bottom: 1px solid rgba(218, 196, 125, 0.45);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.brandmark {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 700;
}

.app-nav {
  display: flex;
  gap: 1rem;
}

.app-nav a {
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
}

.app-nav a:hover {
  background: rgba(255,255,255,0.75);
}

.hero {
  padding: 3rem 0 1.5rem;
}

.hero-selector {
  padding-top: 4rem;
}

.hero-copy {
  max-width: 940px;
  margin: 0 auto;
  background: var(--paper);
  border: 1px solid #f0df9c;
  border-radius: 28px;
  padding: 2rem;
  box-shadow: var(--shadow);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.8rem;
  color: #9a7b12;
  margin-bottom: 0.75rem;
}

h1, h2 {
  font-family: Georgia, "Times New Roman", serif;
}

h1 {
  font-size: clamp(2.1rem, 5vw, 4.5rem);
  line-height: 1.05;
  margin: 0 0 1rem;
}

.lead,
.prompt,
.guide-panel p,
.guide-panel li,
.story-review-card p,
.chat-bubble p,
.story-card span,
.teacher-project-card span,
.story-output-body p,
.review-summary-card p {
  font-size: 1.03rem;
  line-height: 1.7;
}

.prompt {
  background: var(--gold-soft);
  border-left: 4px solid var(--gold);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  margin-top: 1.5rem;
}

.actions,
.profile-grid,
.starter-grid,
.teacher-list,
.story-listing {
  display: grid;
  gap: 1rem;
}

.actions,
.profile-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 1.75rem;
}

.profile-card,
.action-card,
.story-card,
.teacher-project-card,
.choice-tile {
  display: block;
  background: #fff;
  border: 1px solid #e4d8a5;
  border-radius: 20px;
  padding: 1rem 1.1rem;
  box-shadow: 0 10px 24px rgba(57, 102, 53, 0.06);
}

.action-card {
  text-align: center;
  font-weight: 700;
  background: var(--leaf);
  border-color: var(--leaf-line);
}

.action-card.muted,
.teacher-card {
  background: #f7f0d7;
  border-color: #e2d39d;
}

.profile-card {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.profile-card p,
.teacher-project-card span,
.story-card span {
  margin: 0.25rem 0 0;
  color: #566356;
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffe27a, #ffd27d, #d6f7d2);
  font-weight: 800;
  font-size: 1.35rem;
}

.guide-panel,
.conversation-shell {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
  padding-bottom: 2rem;
}

.story-listing,
.teacher-list {
  grid-template-columns: 1fr;
}

.story-card,
.teacher-project-card {
  overflow: hidden;
}

.story-card.empty-card,
.teacher-project-card.empty-card {
  background: rgba(255,255,255,0.75);
}

.starter-form,
.story-response-form,
.review-form {
  margin-top: 1.5rem;
}

.starter-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-bottom: 1rem;
}

.choice-tile {
  cursor: pointer;
  position: relative;
  font-weight: 700;
}

.choice-tile input {
  margin-right: 0.5rem;
}

.input-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.story-textarea,
.story-input {
  width: 100%;
  border-radius: 18px;
  border: 1px solid #d9cca0;
  padding: 1rem;
  font: inherit;
  background: #fffdf3;
  box-sizing: border-box;
}

.story-textarea {
  resize: vertical;
}

.button-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.primary-button,
.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.85rem 1.2rem;
  font-weight: 700;
}

.primary-button {
  border: 0;
  background: #2d6e3a;
  color: #fff;
}

.secondary-link {
  background: #fff7d2;
}

.conversation-column,
.draft-column {
  background: rgba(255,255,255,0.8);
  border-radius: 24px;
  padding: 1.25rem;
}

.chat-bubble {
  border-radius: 18px;
  padding: 1rem;
  margin-bottom: 0.9rem;
}

.chat-bubble.rusty {
  background: #fff4ba;
}

.chat-bubble.student {
  background: #dff4d8;
}

.speaker {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 0.4rem;
  color: #6c6330;
}

.story-review-card,
.story-output-body,
.review-summary-card {
  background: rgba(255,255,255,0.84);
  border-radius: 22px;
  padding: 1.25rem;
}

.story-output-body p,
.review-summary-card p {
  margin: 0 0 1rem;
}

.story-output-body p:last-child,
.review-summary-card p:last-child {
  margin-bottom: 0;
}

.app-footer {
  padding: 1rem 0 2rem;
  color: #647364;
}

.app-version-label {
  margin-top: 0.35rem;
  font-size: 0.88rem;
  color: #7a876f;
}

.starter-guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.9rem;
  margin: 1.5rem 0;
}

.starter-guide-card {
  background: rgba(255,255,255,0.82);
  border: 1px solid #ead9a2;
  border-radius: 18px;
  padding: 1rem;
}

.starter-guide-card p,
.teacher-project-card p,
.story-card p,
.mini-meta {
  margin: 0.4rem 0 0;
  color: #5f6e5f;
  line-height: 1.55;
}

.mini-meta {
  font-size: 0.92rem;
  margin-bottom: 0.8rem;
}

.feedback-chip {
  display: inline-flex;
  margin-top: 0.6rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: #eef8e9;
  border: 1px solid #bddcae;
  color: #476247;
}

.published-chip {
  background: #fff2b8;
  border-color: #e2c65b;
  color: #7d5d00;
}

.child-feedback-card {
  margin-top: 1.25rem;
  background: linear-gradient(135deg, rgba(223, 244, 216, 0.95), rgba(255, 249, 222, 0.98));
  border: 1px solid #cfe2b7;
  border-radius: 22px;
  padding: 1.1rem 1.2rem;
}

.child-feedback-card strong {
  display: block;
  margin-bottom: 0.55rem;
}

.child-feedback-card p {
  margin: 0.35rem 0 0;
  color: #4c5f4c;
  line-height: 1.6;
}

.published-card {
  background: linear-gradient(135deg, rgba(255, 242, 184, 0.96), rgba(255, 249, 222, 0.98));
  border-color: #e2c65b;
}

.publish-banner {
  margin-top: 1.25rem;
  background: rgba(255,255,255,0.82);
  border: 1px solid #ead9a2;
  border-radius: 22px;
  padding: 1.1rem 1.2rem;
}

.publish-banner.published {
  background: linear-gradient(135deg, rgba(255, 242, 184, 0.96), rgba(223, 244, 216, 0.95));
  border-color: #d7bf66;
}

.publish-banner strong {
  display: block;
  margin-bottom: 0.45rem;
}

.publish-banner p {
  margin: 0;
  color: #4c5f4c;
  line-height: 1.6;
}

.inline-form {
  margin: 0;
}

.cover-idea-form {
  margin-top: 1.5rem;
}

.compact-row {
  align-items: center;
}

.secondary-button {
  border: 1px solid #d8c88f;
  background: #fff9de;
  border-radius: 999px;
  padding: 0.8rem 1.1rem;
  font-weight: 700;
}

.story-card-header,
.teacher-project-header {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr;
  gap: 1rem;
  align-items: start;
}

.cover-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid #e4d8a5;
  background: linear-gradient(135deg, #fff3b8, #dff4d8);
}

.cover-preview-card {
  margin-top: 1.5rem;
  background: linear-gradient(135deg, rgba(255, 249, 222, 0.98), rgba(223, 244, 216, 0.98));
  border: 1px solid #e4d8a5;
  border-radius: 24px;
  padding: 1rem;
  box-shadow: 0 10px 24px rgba(57, 102, 53, 0.08);
}

.cover-preview-card strong,
.review-summary-card strong {
  display: block;
  margin-bottom: 0.75rem;
}

.cover-preview {
  width: min(100%, 520px);
  border-radius: 20px;
  border: 1px solid rgba(143, 116, 32, 0.18);
  box-shadow: 0 14px 32px rgba(57, 102, 53, 0.12);
}

.story-output-shell {
  max-width: 860px;
}

.story-poster-card {
  display: grid;
  justify-items: start;
}

.story-poster {
  width: min(100%, 640px);
}

.story-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0 0.25rem;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  background: rgba(255,255,255,0.85);
  border: 1px solid #e4d8a5;
  border-radius: 999px;
  padding: 0.55rem 0.85rem;
  font-size: 0.94rem;
  color: #5f6e5f;
}

.cover-caption,
.timestamp {
  display: block;
  margin-top: 0.65rem;
  color: #5f6e5f;
  line-height: 1.5;
}

.teacher-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.25rem;
}

.meta-card {
  background: rgba(255,255,255,0.82);
  border: 1px solid #ead9a2;
  border-radius: 18px;
  padding: 1rem;
}

.meta-card p,
.teacher-project-card small {
  margin: 0.4rem 0 0;
  color: #5f6e5f;
  line-height: 1.5;
}

@media (max-width: 768px) {
  .header-inner,
  .guide-panel,
  .conversation-shell {
    grid-template-columns: 1fr;
    display: grid;
  }

  .header-inner {
    gap: 0.75rem;
  }

  .app-nav {
    flex-wrap: wrap;
  }

  .button-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .story-card-header,
  .teacher-project-header {
    grid-template-columns: 1fr;
  }
}


.story-packet {
  position: relative;
}

.story-packet-header {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: start;
}

.print-section {
  break-inside: avoid;
}

.no-print {
  display: flex;
}

.print-only {
  display: none;
}

.print-footer {
  border-top: 1px solid #d9cca0;
  margin-top: 1.5rem;
  padding-top: 0.8rem;
  color: #5f6e5f;
  font-size: 0.95rem;
}

@media print {
  @page {
    size: letter;
    margin: 0.55in;
  }

  html,
  body {
    background: #fff;
    font-size: 12pt;
  }

  .app-header,
  .app-footer,
  .no-print {
    display: none !important;
  }

  .print-only {
    display: block;
  }

  .app-shell,
  .hero-copy,
  .story-output-shell {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    box-shadow: none;
    border: 0;
    background: #fff;
  }

  .hero {
    padding: 0;
  }

  .story-packet-header {
    display: block;
  }

  .prompt,
  .publish-banner,
  .cover-preview-card,
  .meta-card,
  .review-summary-card,
  .story-output-body {
    background: #fff !important;
    box-shadow: none;
    border: 1px solid #d6d6d6;
  }

  .story-stat-row {
    margin: 0.75rem 0;
  }

  .stat-pill {
    background: #fff;
    border: 1px solid #bfbfbf;
    color: #333;
  }

  .cover-preview {
    width: 100%;
    max-width: 6.5in;
    box-shadow: none;
  }

  .teacher-meta-grid {
    grid-template-columns: 1fr 1fr;
  }

  .story-output-body p,
  .review-summary-card p,
  .meta-card p,
  .publish-banner p {
    color: #111;
  }

  a,
  a:visited {
    color: #111;
    text-decoration: none;
  }
}


.story-card-page {
  padding-top: 2rem;
}

.story-card-preview-shell {
  width: min(980px, 100%);
  margin: 0 auto;
}

.story-card-preview {
  background: linear-gradient(180deg, #fffdf6 0%, #fff5cb 100%);
  border: 1px solid #e4d8a5;
  border-radius: 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.story-card-top {
  padding: 2rem 2rem 1.25rem;
}

.story-card-grid {
  display: grid;
  grid-template-columns: 1fr 0.9fr;
  gap: 0;
}

.story-card-copy {
  padding: 1.5rem 2rem 2rem;
  background: rgba(255,255,255,0.78);
}

.story-card-copy p {
  line-height: 1.7;
}

.story-card-art {
  padding: 1.5rem;
  display: grid;
  align-content: center;
  background: linear-gradient(180deg, rgba(223,244,216,0.75), rgba(255,249,222,0.92));
}

.compact-review-card {
  margin-top: 1rem;
}

@media (max-width: 900px) {
  .story-card-grid {
    grid-template-columns: 1fr;
  }
}


.family-share-shell {
  max-width: 1040px;
}

.family-share-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-top: 2rem;
}

.family-share-card {
  display: grid;
  grid-template-rows: auto 1fr;
  background: rgba(255,255,255,0.96);
  border: 1px solid #e4d8a5;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 18px 36px rgba(57, 102, 53, 0.08);
}

.family-share-cover {
  display: block;
  background: linear-gradient(180deg, #fff9dc 0%, #eef7f0 100%);
  padding: 1rem;
}

.family-share-cover img {
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(159, 210, 143, 0.5);
}

.family-share-card-body {
  display: grid;
  gap: 1rem;
  padding: 1.35rem;
}

.family-share-card-body h2 {
  margin: 0;
  font-size: 1.5rem;
}

.family-share-card-body > p {
  margin: 0;
}

.family-share-byline {
  color: #7a6b32;
  font-weight: 700;
}

.family-share-session {
  color: #4c5d4c;
}

.family-share-empty {
  margin-top: 2rem;
  background: rgba(255,255,255,0.9);
  border: 1px dashed #d6c06a;
  border-radius: 20px;
  padding: 1.5rem;
}

.compact-review {
  margin: 0;
}

@media (max-width: 768px) {
  .family-share-grid {
    grid-template-columns: 1fr;
  }
}


.featured-story-card {
  display: grid;
  grid-template-columns: 1.2fr 0.95fr;
  gap: 1.5rem;
  align-items: stretch;
  margin-top: 2rem;
  padding: 1.5rem;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255, 250, 222, 0.96), rgba(230, 246, 231, 0.92));
  border: 1px solid #e4d8a5;
  box-shadow: 0 18px 36px rgba(57, 102, 53, 0.08);
}

.featured-story-copy {
  display: grid;
  gap: 1rem;
}

.featured-story-copy h2,
.family-share-section-head h2,
.family-share-card-body h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
}

.featured-story-cover {
  display: block;
  align-self: center;
  padding: 0.5rem;
}

.featured-story-cover img {
  width: 100%;
  border-radius: 24px;
  border: 1px solid rgba(159, 210, 143, 0.5);
  background: rgba(255,255,255,0.92);
}

.featured-session {
  margin: 0;
}

.family-share-collection {
  margin-top: 2.5rem;
}

.family-share-section-head {
  margin-bottom: 1rem;
}

.family-share-section-head p {
  margin: 0.35rem 0 0;
  color: #566356;
}

.family-share-card-body h3 {
  font-size: 1.35rem;
}

@media (max-width: 900px) {
  .featured-story-card {
    grid-template-columns: 1fr;
  }
}


.celebration-banner,
.story-helper-banner,
.milestone-card,
.story-checklist,
.mini-guide-card {
  border-radius: 20px;
  padding: 1rem 1.1rem;
}

.celebration-banner {
  margin-top: 1.5rem;
  background: linear-gradient(135deg, #fff4ba, #dff4d8);
  border: 1px solid #d5cb8a;
}

.celebration-banner p,
.story-helper-banner p,
.milestone-card p,
.mini-guide-card p {
  margin: 0.4rem 0 0;
}

.quick-guide-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.mini-guide-card {
  background: rgba(255,255,255,0.84);
  border: 1px solid #e4d8a5;
}

.story-helper-banner,
.milestone-card {
  margin-top: 1.5rem;
  background: #f7f2d8;
  border: 1px solid #dfcf98;
}

.celebration-card {
  background: linear-gradient(135deg, #fff7cb, #edf8dd);
}

.story-checklist {
  margin-top: 1rem;
  background: rgba(255,255,255,0.75);
  border: 1px dashed #ccb96c;
}

.story-checklist ul {
  margin: 0.6rem 0 0;
  padding-left: 1.2rem;
}

.story-checklist li {
  margin-bottom: 0.35rem;
}

.compact-checklist {
  margin-top: 1rem;
}

.review-checklist {
  margin-top: 1.5rem;
}


.teacher-summary-row,
.teacher-board {
  display: grid;
  gap: 1rem;
}

.teacher-summary-row {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin-top: 1.5rem;
}

.teacher-summary-card {
  background: rgba(255,255,255,0.86);
}

.teacher-board {
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  align-items: start;
  margin-bottom: 2rem;
}

.teacher-board-column {
  display: grid;
  gap: 1rem;
}

.teacher-section-head h2 {
  margin-bottom: 0.35rem;
}

.teacher-section-head p {
  margin: 0;
  color: #566356;
}

.teacher-priority-card {
  border-color: #d7c15e;
  background: linear-gradient(135deg, rgba(255,249,214,0.96), rgba(240,248,225,0.94));
}

.teacher-published-strip {
  margin: 1rem 0 2rem;
  padding: 1.25rem;
  border-radius: 24px;
  background: rgba(255,255,255,0.82);
  border: 1px solid #e4d8a5;
}

.teacher-published-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.teacher-decision-card {
  background: linear-gradient(135deg, #fff7cb, #eef8df);
}

.teacher-review-layout {
  align-items: start;
}

.teacher-review-companion-panel {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.teacher-checklist {
  margin-bottom: 1rem;
}

@media (max-width: 900px) {
  .teacher-board {
    grid-template-columns: 1fr;
  }
}


.home-shell {
  max-width: 980px;
}

.home-guide-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 1.75rem;
}

.home-actions {
  margin-top: 1.25rem;
}

@media (max-width: 768px) {
  .app-header {
    position: static;
  }

  .header-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .app-nav {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
  }

  .app-nav a {
    padding: 0.45rem 0.7rem;
  }

  .hero-copy {
    padding: 1.35rem;
    border-radius: 22px;
  }

  .prompt {
    padding: 0.85rem 0.95rem;
  }

  .teacher-meta-grid {
    grid-template-columns: 1fr;
  }

  .story-stat-row {
    gap: 0.55rem;
  }

  .stat-pill {
    width: 100%;
    justify-content: center;
  }
}


.interest-form,
.interest-result-card {
  margin-top: 1.5rem;
}

.interest-result-card {
  background: linear-gradient(135deg, rgba(255, 250, 222, 0.98), rgba(230, 246, 231, 0.95));
  border: 1px solid #e4d8a5;
  border-radius: 24px;
  padding: 1.4rem;
}


.interest-bridge-card {
  background: linear-gradient(135deg, rgba(223, 244, 216, 0.95), rgba(255, 249, 222, 0.96));
}

.interest-inline-form {
  margin: 0;
}


.learning-intent-strip {
  margin-bottom: 2rem;
}


.launch-form {
  margin-top: 1rem;
}


.lesson-board-hero {
  padding-bottom: 1rem;
}

.lesson-summary-row,
.lesson-path-row {
  margin-top: 1rem;
}

.teacher-board-links {
  margin-top: 1.25rem;
}

.lesson-board-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
  margin-bottom: 2rem;
}

.lesson-board-column {
  display: grid;
  gap: 1rem;
}

.lesson-card {
  min-height: 180px;
}

.approved-lesson-card {
  background: linear-gradient(135deg, rgba(255, 248, 210, 0.98), rgba(223, 244, 216, 0.96));
  border-color: #d7c15e;
}

@media (max-width: 980px) {
  .lesson-board-grid {
    grid-template-columns: 1fr;
  }
}


.lesson-path-row .teacher-summary-card {
  min-height: 110px;
}


.lesson-board-grid-wide {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.roadmap-card {
  background: linear-gradient(135deg, rgba(255, 244, 197, 0.98), rgba(228, 245, 223, 0.96));
  border-color: #d7b44b;
}

@media (max-width: 980px) {
  .lesson-board-grid-wide {
    grid-template-columns: 1fr;
  }
}


.roadmap-spotlight-card {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    background: linear-gradient(135deg, #fff8e6 0%, #fffdf5 100%);
    border: 1px solid #f0ddb0;
    border-radius: 24px;
    padding: 1.25rem 1.5rem;
    margin: 1.25rem 0;
}

.home-roadmap-spotlight {
    margin-bottom: 1.5rem;
}

.lesson-sequence-pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .75rem;
    border-radius: 999px;
    background: #f6d86a;
    color: #573b00;
    font-weight: 700;
    font-size: .82rem;
    margin-bottom: .6rem;
}

.roadmap-preview-panel,
.roadmap-queue-panel {
    gap: 1.5rem;
}

.roadmap-snapshot-grid,
.roadmap-queue {
    display: grid;
    gap: 1rem;
}

.roadmap-snapshot-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.roadmap-mini-card,
.roadmap-link-card {
    text-decoration: none;
    color: inherit;
}

.roadmap-mini-card {
    min-height: 180px;
}

.roadmap-lesson-layout {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 1.5rem;
}

.handoff-banner {
    margin-top: 1rem;
}

.roadmap-summary-list ul {
    margin: 0;
}

@media (max-width: 900px) {
    .roadmap-spotlight-card,
    .roadmap-lesson-layout {
        display: grid;
        grid-template-columns: 1fr;
    }
}


.roadmap-status-pill {
    border: 1px solid transparent;
}

.roadmap-status-notstarted {
    background: #f5f1e8;
    color: #6a5a3a;
    border-color: #dfd2b4;
}

.roadmap-status-inprogress {
    background: #e8f4ff;
    color: #0f4d7a;
    border-color: #b7d8f3;
}

.roadmap-status-completed {
    background: #e5f6ea;
    color: #1d6a35;
    border-color: #b7e0c4;
}


.roadmap-celebration-banner {
  margin-top: 1rem;
}

.teacher-smart-response-panel {
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.teacher-smart-response-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.teacher-smart-card {
  min-height: 220px;
}

@media (max-width: 980px) {
  .teacher-smart-response-grid {
    grid-template-columns: 1fr;
  }
}


.teacher-handoff-panel {
  margin-top: 0;
}

.teacher-planning-companion-panel {
  margin-top: 0;
}

.teacher-dashboard-companion-panel {
  margin-top: 0;
  margin-bottom: 2rem;
}

.planning-companion-card {
  min-height: 0;
  background: linear-gradient(135deg, rgba(255, 249, 214, 0.98), rgba(231, 246, 232, 0.95));
  border: 1px solid #d9c774;
}

.teacher-planning-starters {
  margin-top: 1rem;
}

.planning-starter-list {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
}

.planning-starter-card {
  background: rgba(255,255,255,0.86);
  border: 1px solid #e4d8a5;
  border-radius: 18px;
  padding: 1rem;
}

.planning-starter-card p {
  margin: 0 0 0.85rem;
}

.planning-starter-button {
  width: fit-content;
}

.planning-workspace-card {
  margin-top: 1rem;
}

.planning-workspace-form {
  margin-top: 1rem;
}

.handoff-candidate-card {
  min-height: 230px;
}

.teacher-roadmap-actions {
  margin-top: 1rem;
}


.teacher-arc-panel {
  margin-top: 0;
}

.arc-form-card {
  display: grid;
  gap: 1rem;
}

.candidate-select-row {
  margin-bottom: .5rem;
}

.teacher-arc-panel .button-row {
    margin-top: 0.85rem;
}

.arc-form-card .button-row {
    flex-wrap: wrap;
}

.arc-summary-grid {
    align-items: stretch;
}

.arc-summary-card {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.arc-summary-card small {
    display: block;
    color: var(--muted-ink, #5a5a5a);
}

.roadmap-arc-line {
    display: block;
    margin-top: 0.35rem;
    color: var(--muted-ink, #5a5a5a);
}

.arc-celebration-banner {
    background: linear-gradient(135deg, #fff8d6, #ffe9a8);
}

.roadmap-arc-highlight {
    margin-bottom: 1rem;
}

.roadmap-arc-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 1rem 0 1.25rem;
}

.roadmap-arc-summary-card {
    min-height: 0;
}

.arc-guidance-banner small {
    display: block;
    margin-top: 0.45rem;
}

.arc-transition-banner small,
.arc-celebration-banner small {
    display: block;
    margin-top: 0.45rem;
}

.roadmap-next-arc-chip {
    background: #fff7d6;
    border-radius: 999px;
    padding: 0.45rem 0.9rem;
}

.roadmap-next-wave-card,
.next-wave-invitation-card {
    margin-top: 1rem;
}

.roadmap-next-wave-card small,
.next-wave-invitation-card small {
    display: block;
    margin-top: 0.4rem;
}

.next-wave-ready-banner {
    background: linear-gradient(135deg, #eef9ff, #dff4ff);
}

.arc-sync-line {
    display: block;
    color: var(--muted-ink, #5a5a5a);
}

.intervention-chip {
    background: #eef3ff;
    color: #274690;
}

.intervention-fresh {
    background: #e7f8ec;
    color: #21643b;
}

.intervention-stalled {
    background: #fff1d9;
    color: #8a4b08;
}

.intervention-action-row {
    margin-top: 0.75rem;
}

.arc-note-card,
.arc-note-form {
    margin-top: 0.85rem;
}

.note-input {
    width: 100%;
    min-height: 5.5rem;
}

.story-edit-form {
    margin-top: 1rem;
}

.story-edit-card {
    margin-bottom: 1rem;
}

.story-rename-row {
    align-items: stretch;
}

.story-rename-row .story-input {
    flex: 1 1 320px;
}

.story-moment-workbench {
    margin-top: 1.5rem;
    display: grid;
    gap: 1rem;
}

.story-moment-card {
    background: rgba(255,255,255,0.82);
    border: 1px solid #ead9a2;
    border-radius: 20px;
    padding: 1rem;
}

.story-moment-card strong {
    display: block;
    margin-bottom: 0.6rem;
}

.storyteller-coach-card {
    margin-top: 1rem;
}

.story-coach-prompt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
    margin-top: 0.85rem;
}

.story-coach-button {
    text-align: left;
    justify-content: flex-start;
    line-height: 1.45;
}

.arc-note-history {
    margin-top: 0.65rem;
}

.arc-note-history small {
    display: block;
    margin-top: 0.35rem;
}


.arc-note-suggestion-card {
    margin-bottom: 0.9rem;
}

.arc-note-purpose-encouragement {
    background: linear-gradient(135deg, rgba(223, 244, 216, 0.96), rgba(255, 249, 222, 0.96));
    border-color: #bcdcab;
}

.arc-note-purpose-focus {
    background: linear-gradient(135deg, rgba(229, 243, 255, 0.96), rgba(242, 248, 255, 0.98));
    border-color: #bdd6ef;
}

.arc-note-purpose-celebration {
    background: linear-gradient(135deg, rgba(255, 243, 186, 0.98), rgba(255, 250, 221, 0.99));
    border-color: #dfc66b;
}

.learner-note-toggle {
    align-items: center;
    gap: 0.55rem;
}


.arc-note-template-context,
.arc-note-template-line {
    display: block;
    margin-top: 0.55rem;
    color: #5a5a5a;
}

.arc-note-template-context {
    font-weight: 700;
}

.arc-note-template-button {
    margin-top: 0.85rem;
}

.arc-note-guidance-banner,
.roadmap-arc-note-line {
    color: var(--muted-ink, #5a5a5a);
}

.arc-note-guidance-banner small,
.roadmap-arc-note-line {
    display: block;
    margin-top: 0.4rem;
}

.arc-note-guidance-banner,
.roadmap-arc-summary-card,
.arc-guidance-banner,
.milestone-card.arc-note-encouragement,
.milestone-card.arc-note-focus,
.milestone-card.arc-note-celebration {
    transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.arc-note-encouragement {
    background: linear-gradient(135deg, rgba(223, 244, 216, 0.98), rgba(255, 249, 222, 0.98));
    border-color: #bcdcab;
}

.arc-note-focus {
    background: linear-gradient(135deg, rgba(229, 243, 255, 0.98), rgba(242, 248, 255, 0.98));
    border-color: #bdd6ef;
}

.arc-note-celebration {
    background: linear-gradient(135deg, rgba(255, 243, 186, 0.98), rgba(255, 250, 221, 0.99));
    border-color: #dfc66b;
}

.arc-note-guidance-banner.arc-note-celebration strong,
.roadmap-arc-summary-card.arc-note-celebration strong,
.arc-guidance-banner.arc-note-celebration strong {
    color: #8a5a00;
}

.arc-note-guidance-banner.arc-note-focus strong,
.roadmap-arc-summary-card.arc-note-focus strong,
.arc-guidance-banner.arc-note-focus strong {
    color: #1f4f86;
}

.arc-note-guidance-banner.arc-note-encouragement strong,
.roadmap-arc-summary-card.arc-note-encouragement strong,
.arc-guidance-banner.arc-note-encouragement strong {
    color: #2b6a39;
}

.arc-note-timing-callout {
    display: block;
    margin-top: 0.55rem;
    font-weight: 700;
}

.arc-note-timing-focus {
    box-shadow: 0 14px 28px rgba(69, 116, 177, 0.12);
}

.arc-note-timing-celebration {
    box-shadow: 0 16px 30px rgba(180, 140, 24, 0.12);
}

.roadmap-spotlight-card.arc-note-focus .arc-note-timing-callout,
.milestone-card.arc-note-focus .arc-note-timing-callout {
    color: #1f4f86;
}

.arc-celebration-banner .arc-note-timing-callout,
.milestone-card.arc-note-celebration .arc-note-timing-callout {
    color: #8a5a00;
}

.arc-guidance-banner.arc-note-encouragement .roadmap-arc-line {
    color: #2b6a39;
}


.compact-top-gap {
    margin-top: 0.75rem;
}

.app-auth-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.compact-auth-button {
    padding: 0.55rem 1rem;
    font-size: 0.95rem;
}

.auth-shell {
    max-width: 68rem;
}

.auth-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.auth-message-card,
.auth-error-card {
    margin-top: 1rem;
}

.auth-error-card {
    border-color: rgba(150, 45, 45, 0.25);
    background: rgba(255, 239, 234, 0.9);
}

.admin-role-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: 0.5rem 1rem;
}

.admin-user-list {
    display: grid;
    gap: 1rem;
}

.admin-user-card,
.admin-create-card {
    background: rgba(255, 255, 255, 0.9);
}

.admin-user-header {
    justify-content: space-between;
    align-items: flex-start;
}

.admin-user-card small {
    display: block;
    margin-top: 0.35rem;
}

.admin-reset-form {
    border-top: 1px solid rgba(222, 205, 148, 0.8);
    padding-top: 1rem;
}

.irts-status-card {
    border-width: 1px;
}

.irts-status-live {
    background: linear-gradient(135deg, rgba(223, 244, 216, 0.95), rgba(247, 255, 238, 0.96));
    border-color: #bcdcab;
}

.irts-status-warning {
    background: linear-gradient(135deg, rgba(255, 244, 205, 0.96), rgba(255, 250, 232, 0.97));
    border-color: #e1c770;
}

.irts-status-offline {
    background: linear-gradient(135deg, rgba(243, 241, 236, 0.96), rgba(255, 255, 255, 0.97));
    border-color: #d8cfba;
}

.roadmap-memory-image {
  width: 100%;
  max-width: 320px;
  border-radius: 18px;
  margin-top: 1rem;
  border: 1px solid rgba(201, 171, 96, 0.45);
  box-shadow: 0 10px 24px rgba(50, 73, 54, 0.12);
}

.story-audio-player {
  width: 100%;
  margin-top: 0.9rem;
}

.home-audio-player {
  max-width: 420px;
}

.narration-feedback-card {
  background: linear-gradient(135deg, rgba(255, 247, 203, 0.96), rgba(223, 244, 216, 0.95));
  border-color: #d9c56f;
}

.narration-ready-banner audio {
  margin-top: 0.85rem;
}

.family-share-audio-note {
  margin: 0.85rem 0 0;
  color: #5d6b57;
}

.narration-family-card {
  background: linear-gradient(135deg, rgba(255, 247, 203, 0.96), rgba(240, 248, 255, 0.98));
  border-color: #d7c36b;
}

.compact-list {
  margin: 0.75rem 0 0;
  padding-left: 1.25rem;
}

.compact-list li {
  margin-top: 0.35rem;
}

.invitation-handoff-card {
  background: linear-gradient(180deg, #fff9df 0%, #fffef4 100%);
}

.invitation-share-text {
  min-height: 7rem;
}

.companion-shell {
  width: 100%;
  max-width: none;
  min-width: 0;
}

.companion-hero-copy {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.companion-primary-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
  gap: 1.5rem;
  padding-bottom: 2rem;
  align-items: start;
  overflow: hidden;
}

.companion-main-stack,
.companion-sidebar-stack,
.companion-conversation-stack {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.companion-composer-card {
  background: linear-gradient(135deg, rgba(255, 249, 214, 0.98), rgba(231, 246, 232, 0.95));
  border: 1px solid #d9c774;
  box-shadow: 0 18px 36px rgba(57, 102, 53, 0.08);
}

.companion-conversation-card {
  min-height: 320px;
}

.companion-section-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}

.companion-section-head-tight {
  margin-bottom: 0.75rem;
}

.companion-section-head h2 {
  margin-top: 0;
  margin-bottom: 0.4rem;
}

.companion-live-status {
  max-width: 280px;
  flex: 0 0 280px;
}

.companion-thread-meta {
  margin-top: 0;
  text-align: right;
}

.planning-starter-card-active {
  border-color: rgba(45, 94, 70, 0.55);
  box-shadow: 0 0 0 1px rgba(45, 94, 70, 0.18);
  background: linear-gradient(180deg, rgba(255, 248, 219, 0.98), rgba(244, 250, 244, 0.98));
}

.companion-primary-textarea {
  min-height: 11rem;
  background: rgba(255, 255, 255, 0.9);
}

.companion-chat-form {
  margin-top: 0;
}

.companion-empty-state {
  border: 1px dashed #d8c88f;
  background: rgba(255, 253, 243, 0.88);
}

.companion-collapsible {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid #ead9a2;
  border-radius: 22px;
  padding: 0;
  overflow: hidden;
}

.companion-collapsible + .companion-collapsible {
  margin-top: 1rem;
}

.companion-collapsible summary {
  cursor: pointer;
  list-style: none;
  padding: 1rem 1.2rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.companion-collapsible summary::-webkit-details-marker {
  display: none;
}

.companion-collapsible summary::after {
  content: "+";
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff7d2;
  border: 1px solid #e4d8a5;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.companion-collapsible[open] summary::after {
  content: "−";
}

.companion-collapsible-open summary {
  background: linear-gradient(180deg, rgba(255, 250, 222, 0.96), rgba(255, 255, 255, 0.9));
}

.companion-collapsible-body {
  padding: 0 1.2rem 1.2rem;
}

@media (max-width: 980px) {
  .companion-primary-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .companion-section-head {
    flex-direction: column;
  }

  .companion-live-status {
    max-width: none;
    width: 100%;
  }

  .companion-thread-meta {
    text-align: left;
  }
}

/*
 * companion-sticky.css
 * Add to site.css (or @import from site.css) after the existing companion rules.
 * Implements the sticky chat panel layout — page content scrolls left,
 * companion panel stays fixed right, exactly like the Claude interface.
 *
 * Requires: the existing .companion-primary-layout, .companion-sidebar-stack,
 * and .app-header rules in site.css remain unchanged.
 */

:root {
    --header-h: 110px;
}

.companion-scroll-region::-webkit-scrollbar {
    width: 5px;
}

.companion-scroll-region::-webkit-scrollbar-thumb {
    background: #d9cca0;
    border-radius: 3px;
}

.companion-sticky-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid rgba(218, 196, 125, 0.45);
    background: linear-gradient(135deg, rgba(255, 250, 222, 0.98), rgba(231, 246, 232, 0.96));
}

.companion-sticky-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffe27a, #d6f7d2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    cursor: pointer;
    border: 2px solid rgba(218, 196, 125, 0.6);
    flex-shrink: 0;
    transition: transform 120ms ease;
    user-select: none;
}

.companion-sticky-avatar:hover {
    transform: scale(1.08);
}

.companion-sticky-avatar-name {
    flex: 1;
    min-width: 0;
}

.companion-sticky-avatar-name strong {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.companion-sticky-avatar-name span {
    display: block;
    font-size: 0.77rem;
    color: #7a6b32;
    margin-top: 1px;
}

.companion-sticky-change-btn {
    font-size: 0.75rem;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    border: 1px solid #d8c88f;
    background: #fff9de;
    color: #6c5a1a;
    cursor: pointer;
    white-space: nowrap;
    font-weight: 700;
    flex-shrink: 0;
}

.companion-sticky-change-btn:hover {
    background: #fff4ba;
}

.companion-sticky-messages::-webkit-scrollbar {
    width: 4px;
}

.companion-sticky-messages::-webkit-scrollbar-thumb {
    background: #d9cca0;
    border-radius: 2px;
}

.companion-sticky-messages .chat-bubble {
    margin-bottom: 0;
    font-size: 0.9rem;
}

.companion-sticky-messages .chat-bubble.rusty {
    border-radius: 18px 18px 18px 4px;
}

.companion-sticky-messages .chat-bubble.student {
    border-radius: 18px 18px 4px 18px;
    margin-left: auto;
    max-width: 88%;
}

.companion-sticky-chips {
    flex-shrink: 0;
    padding: 0.6rem 0.9rem;
    border-top: 1px solid rgba(218, 196, 125, 0.35);
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.companion-sticky-chip {
    font-size: 0.77rem;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    border: 1px solid #d8c88f;
    background: #fffdf3;
    color: #6c5a1a;
    cursor: pointer;
    font-weight: 700;
    transition: background 100ms ease;
}

.companion-sticky-chip:hover {
    background: var(--gold-soft);
    border-color: var(--gold);
}

.companion-sticky-input-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid #d9cca0;
    border-radius: 999px;
    padding: 0.5rem 0.6rem 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.92);
}

.companion-sticky-input-row input {
    flex: 1;
    border: none;
    outline: none;
    font: inherit;
    font-size: 0.88rem;
    background: transparent;
    color: var(--ink);
}

.companion-sticky-input-row input::placeholder {
    color: #a0966a;
}

.companion-sticky-send {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 0;
    background: #2d6e3a;
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 100ms ease;
}

.companion-sticky-send:hover {
    background: #235530;
}

.companion-avatar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(31, 42, 31, 0.45);
    align-items: center;
    justify-content: center;
}

.companion-avatar-overlay.open {
    display: flex;
}

.companion-avatar-picker {
    background: rgba(255, 253, 243, 0.99);
    border: 1px solid #e4d8a5;
    border-radius: 28px;
    padding: 1.5rem;
    width: min(420px, calc(100vw - 2rem));
    box-shadow: 0 28px 60px rgba(57, 102, 53, 0.18);
}

.companion-avatar-picker h3 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.35rem;
    margin: 0 0 0.3rem;
}

.companion-avatar-picker p {
    font-size: 0.88rem;
    color: #647364;
    margin: 0 0 1rem;
}

.companion-picker-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.9rem;
}

.companion-picker-cat {
    font-size: 0.77rem;
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    border: 1px solid #d8c88f;
    background: #fffdf3;
    color: #6c5a1a;
    cursor: pointer;
    font-weight: 700;
}

.companion-picker-cat.active {
    background: var(--leaf);
    border-color: var(--leaf-line);
    color: #2d5e27;
}

.companion-picker-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.3rem;
    max-height: 220px;
    overflow-y: auto;
    padding: 0.25rem;
    scrollbar-width: thin;
    scrollbar-color: #d9cca0 transparent;
}

.companion-picker-emoji {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: background 80ms ease;
}

.companion-picker-emoji:hover {
    background: var(--leaf);
    border-color: var(--leaf-line);
}

.companion-picker-emoji.selected {
    background: var(--gold-soft);
    border-color: var(--gold);
}

.companion-picker-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.1rem;
    padding-top: 0.9rem;
    border-top: 1px solid #ead9a2;
}

.companion-picker-actions .secondary-button {
    font-size: 0.88rem;
    padding: 0.6rem 1rem;
}

.companion-picker-actions .primary-button {
    font-size: 0.88rem;
    padding: 0.6rem 1.1rem;
}

.companion-sticky-shell.theme-learner .companion-sticky-header {
    background: linear-gradient(135deg, rgba(223, 244, 216, 0.98), rgba(255, 250, 222, 0.95));
}

.companion-sticky-shell.theme-learner .companion-sticky-send {
    background: #3b6d11;
}

.companion-sticky-shell.theme-learner .companion-sticky-send:hover {
    background: #2b5009;
}

.companion-sticky-shell.theme-learner .companion-sticky-chip:hover {
    background: var(--leaf);
    border-color: var(--leaf-line);
}

.companion-sticky-shell.theme-learner .companion-sticky-messages .chat-bubble.rusty {
    background: #e9f8e2;
}

.companion-sticky-shell.theme-family .companion-sticky-header {
    background: linear-gradient(135deg, rgba(255, 248, 210, 0.98), rgba(255, 252, 235, 0.96));
}

.companion-sticky-shell.theme-family .companion-sticky-send {
    background: #8a5e00;
}

.companion-sticky-shell.theme-family .companion-sticky-send:hover {
    background: #6b4800;
}

.companion-sticky-shell.theme-family .companion-sticky-messages .chat-bubble.rusty {
    background: #fff7e0;
}

.app-nav a[aria-current="page"] {
    background: rgba(255, 255, 255, 0.85);
    font-weight: 700;
    color: #2d6e3a;
}

.app-nav-learner a {
    font-size: 1.05rem;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
}

.app-nav-learner a:hover {
    background: var(--leaf);
}

.app-nav-learner a[aria-current="page"] {
    background: var(--leaf);
    color: #2d5e27;
    border: 1px solid var(--leaf-line);
}

.brandmark-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
}

.role-badge {
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 1px 7px;
    border-radius: 999px;
    line-height: 1.6;
}

.role-badge-teacher {
    background: #fff4ba;
    color: #5a4500;
    border: 1px solid #e2c65b;
}

.role-badge-learner {
    background: #dff4d8;
    color: #2d5e27;
    border: 1px solid #9fd28f;
}

.role-badge-family {
    background: #fff0f5;
    color: #72243e;
    border: 1px solid #f4c0d1;
}

.role-badge-admin {
    background: #f0e8ff;
    color: #4a2d8a;
    border: 1px solid #c9aef5;
}

.app-toolbar {
    border-bottom: 1px solid rgba(218, 196, 125, 0.35);
    background: rgba(255, 252, 235, 0.92);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 9;
}

.app-toolbar-inner {
    width: min(1100px, calc(100% - 2rem));
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 0;
}

.tb-icon-btn {
    position: relative;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7a6b32;
    transition: background 100ms ease;
}

.tb-icon-btn:hover {
    background: rgba(218, 196, 125, 0.25);
}

.tb-icon-btn.tb-active {
    background: rgba(218, 196, 125, 0.35);
    color: #3b6d11;
}

.tb-icon-btn svg {
    width: 17px;
    height: 17px;
}

.tb-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 15px;
    height: 15px;
    border-radius: 999px;
    background: #2d6e3a;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
}

.tb-badge:empty {
    display: none;
}

.tb-tooltip {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #1f2a1f;
    color: #fff;
    font-size: 0.68rem;
    padding: 4px 9px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 120ms ease;
    z-index: 50;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

.tb-icon-btn:hover .tb-tooltip {
    opacity: 1;
}

.tb-divider {
    width: 1px;
    height: 20px;
    background: rgba(218, 196, 125, 0.45);
    margin: 0 4px;
    flex-shrink: 0;
}

.tb-icon-btn.tb-future {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}

.tb-layout-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1.5px solid #d8c88f;
    background: #fff9de;
    color: #6c5a1a;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    transition: all 120ms ease;
    white-space: nowrap;
}

.tb-layout-toggle:hover {
    background: #fff4ba;
    border-color: #c4ad72;
}

.tb-layout-toggle.full-active {
    background: var(--leaf);
    border-color: var(--leaf-line);
    color: #2d5e27;
}

.tb-drawer-inner {
    padding: 14px 16px;
    background: rgba(255, 253, 243, 0.98);
    max-height: min(60vh, 640px);
    overflow-y: auto;
}

.tb-drawer-title {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.02rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.tb-drawer-body {
    color: #5f6b5f;
    line-height: 1.6;
}

.tb-drawer-body .planning-starter-list,
.tb-drawer-body .mini-guide-card + .mini-guide-card {
    margin-top: 0.85rem;
}

.tb-drawer-body .secondary-link {
    display: inline-flex;
    align-items: center;
}

.lil-emoji-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(31, 42, 31, 0.25);
    align-items: center;
    justify-content: center;
}

.lil-emoji-overlay.open {
    display: flex;
}

.lil-emoji-picker {
    background: rgba(255, 253, 243, 0.99);
    border: 1px solid #e4d8a5;
    border-radius: 24px;
    padding: 1.1rem;
    width: min(380px, calc(100vw - 2rem));
    box-shadow: 0 20px 48px rgba(120, 104, 34, 0.14);
}

.lil-emoji-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.lil-emoji-title {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ink);
}

.lil-emoji-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #d8c88f;
    background: #fff9de;
    color: #6c5a1a;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lil-emoji-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

.lil-emoji-cat {
    font-size: 0.72rem;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid #d8c88f;
    background: #fffdf3;
    color: #6c5a1a;
    cursor: pointer;
    font-weight: 700;
    transition: background 80ms ease;
}

.lil-emoji-cat.active {
    background: var(--leaf);
    border-color: var(--leaf-line);
    color: #2d5e27;
}

.lil-emoji-search {
    margin-bottom: 8px;
}

.lil-emoji-search input {
    width: 100%;
    border: 1px solid #d9cca0;
    border-radius: 999px;
    padding: 6px 14px;
    font: inherit;
    font-size: 0.82rem;
    background: #fffdf3;
    color: var(--ink);
    outline: none;
    box-sizing: border-box;
}

.lil-emoji-search input:focus {
    border-color: #c4ad72;
    background: #fff;
}

.lil-emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 3px;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 6px;
    scrollbar-width: thin;
    scrollbar-color: #d9cca0 transparent;
}

.lil-emoji-item {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: background 80ms ease;
}

.lil-emoji-item:hover {
    background: var(--leaf);
    border-color: var(--leaf-line);
}

.lil-emoji-item.selected {
    background: var(--gold-soft);
    border-color: var(--gold);
}

.lil-emoji-hint {
    font-size: 0.7rem;
    color: #7a6b32;
    text-align: center;
    margin-top: 4px;
}

.lil-emoji-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 0.85rem;
}

@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.75rem 0;
    }

    .brandmark {
        flex: 1 0 auto;
    }

    .app-auth-nav {
        flex: 0 0 auto;
    }

    .app-nav {
        order: 3;
        width: 100%;
        flex-wrap: wrap;
        gap: 0.35rem;
        padding-bottom: 0.5rem;
    }

    .app-nav a {
        font-size: 0.88rem;
        padding: 0.4rem 0.65rem;
    }

    .app-nav-learner a {
        font-size: 0.95rem;
        padding: 0.5rem 0.8rem;
    }
}

/* -- 5. Warm up the panel header - align with LIL palette -- */
.companion-sticky-header {
    background: linear-gradient(135deg,
        rgba(255, 250, 222, 0.98) 0%,
        rgba(231, 246, 232, 0.96) 100%);
    border-bottom: 1px solid rgba(218, 196, 125, 0.5);
    padding: 0.85rem 1rem;
}

/* -- 6. Tighten the eyebrow label in panel header -- */
.companion-sticky-avatar-name span {
    color: #9a7b12; /* matches .eyebrow color in site.css */
    font-size: 0.75rem;
    letter-spacing: 0.04em;
}

/* -- 7. Chips - match the secondary-button warmth from site.css -- */
.companion-sticky-chip {
    background: #fff9de;
    border-color: #d8c88f;
    color: #6c5a1a;
    font-size: 0.78rem;
    padding: 0.28rem 0.7rem;
}

.companion-sticky-chip:hover {
    background: var(--gold-soft);
    border-color: var(--gold);
}

/* -- 8. Input row - softer, matches story-textarea feel -- */
.companion-sticky-input-row {
    background: rgba(255, 253, 243, 0.95);
    border-color: #d9cca0;
}

.companion-sticky-input-row:focus-within {
    border-color: #c4ad72;
    background: #fff;
}

/* -- 9. Send button - match primary-button green -- */
.companion-sticky-send {
    background: #2d6e3a;
}

.companion-sticky-send:hover {
    background: #235530;
}

/* -- 10. Chat bubbles in panel - tighten to LIL palette -- */
.companion-sticky-messages .chat-bubble.rusty {
    background: #fff4ba;  /* matches site.css .chat-bubble.rusty exactly */
    border-radius: 18px 18px 18px 4px;
}

.companion-sticky-messages .chat-bubble.student {
    background: var(--leaf); /* matches site.css .chat-bubble.student */
    border-radius: 18px 18px 4px 18px;
    margin-left: auto;
    max-width: 88%;
}

.companion-sticky-messages .speaker {
    font-size: 0.78rem;
    color: #6c6330; /* matches site.css .speaker exactly */
}

.thinking-bubble .thinking-dots {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    min-height: 1.4rem;
}

.thinking-bubble .thinking-dots span {
    width: 0.46rem;
    height: 0.46rem;
    border-radius: 50%;
    background: #8f7420;
    opacity: 0.35;
    animation: lil-thinking-bounce 1s infinite ease-in-out;
}

.thinking-bubble .thinking-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.thinking-bubble .thinking-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes lil-thinking-bounce {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: 0.35;
    }

    40% {
        transform: translateY(-3px);
        opacity: 1;
    }
}

/* -- 11. Avatar picker modal - warm card, matches hero-copy style -- */
.companion-avatar-picker {
    background: rgba(255, 253, 243, 0.99);
    border: 1px solid #e4d8a5;
    border-radius: 28px;
    box-shadow: 0 20px 45px rgba(120, 104, 34, 0.12); /* matches --shadow */
}

.companion-avatar-picker h3 {
    font-family: Georgia, "Times New Roman", serif;
    color: var(--ink);
}

/* -- 12. Sylvia companion page - same width constraint --
   The learner companion page was also running full-width.
   .companion-sticky-shell already handles this via rule 1 above.
   This rule ensures the learner variant gets the same treatment.  */
.companion-sticky-shell.theme-learner {
    border-left-color: rgba(159, 210, 143, 0.35);
    border-right-color: rgba(159, 210, 143, 0.35);
}

.companion-sticky-shell.theme-family {
    border-left-color: rgba(218, 196, 125, 0.35);
    border-right-color: rgba(218, 196, 125, 0.35);
}

.companion-scroll-region .teacher-summary-row {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.companion-scroll-region .teacher-summary-card strong {
    font-size: 0.88rem;
    line-height: 1.3;
}

.companion-scroll-region .teacher-summary-card p {
    font-size: 0.8rem;
}

/*
 * COMPANION LAYOUT — DEFINITIVE REWRITE
 * Replaces ALL previous companion layout rules in site.css
 * Date: 2026-03-25
 *
 * ARCHITECTURE:
 *   <body>
 *     <header class="app-header">          ← sticky, z-index 10
 *     <div class="app-toolbar">            ← sticky, z-index 9, full width
 *     <main class="companion-page-main">   ← fills remaining viewport height
 *       <div class="tb-drawer-host">       ← collapses to 0, expands on open
 *       <div class="companion-sticky-shell">  ← flex row, fills remaining
 *         <div class="companion-scroll-region">  ← left col, scrolls
 *         <aside class="companion-sticky-panel"> ← right col, never moves
 *           <div class="companion-sticky-header"> ← fixed within panel
 *           <div class="companion-sticky-messages"> ← scrolls within panel
 *           <div class="companion-sticky-chips">    ← fixed within panel
 *           <div class="companion-sticky-input">    ← fixed within panel
 *
 * SEARCH FOR AND DELETE these selectors before pasting this block:
 *   .companion-page-main
 *   .companion-sticky-shell
 *   .companion-scroll-region
 *   .companion-sticky-panel
 *   .companion-sticky-messages  (all occurrences)
 *   .companion-sticky-input     (if declared separately)
 *   .tb-drawer-host
 *   .tb-drawer-host.open
 *   :root { --header-h  (the companion one — keep the main :root block)
 */

/* ── 1. CSS variable — updated by JS after render ── */
:root {
    --header-h: 110px; /* nav (~60px) + toolbar (~44px) — JS overrides this */
}

/* ── 2. Header and toolbar — both sticky, stacked, full width ── */
.app-header {
    position: sticky;
    top: 0;
    z-index: 10;
    width: 100%;
    backdrop-filter: blur(14px);
    background: rgba(255, 252, 235, 0.84);
    border-bottom: 1px solid rgba(218, 196, 125, 0.45);
}

.app-toolbar {
    position: sticky;
    top: 0;   /* stacks below header naturally in document flow */
    z-index: 9;
    width: 100%;
    border-bottom: 1px solid rgba(218, 196, 125, 0.35);
    background: rgba(255, 252, 235, 0.92);
    backdrop-filter: blur(10px);
}

.app-toolbar-inner {
    width: min(1100px, calc(100% - 2rem));
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 0;
}

/* ── 3. companion-page-main — fills exact remaining viewport height ── */
.companion-page-main {
    /* Height = viewport minus the two sticky bars measured by JS */
    height: calc(100vh - var(--header-h) - var(--footer-h, 44px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Width constraint matches app-shell */
    width: min(1100px, calc(100% - 2rem));
    margin: 0 auto;
}

body:has(.companion-page-main) {
    overflow: hidden;
}

/* ── 4. Drawer host — zero height when closed, expands when open ── */
.tb-drawer-host {
    flex-shrink: 0;        /* never grows into sticky shell's space */
    overflow: hidden;
    max-height: 0;
    transition: max-height 280ms ease;
    border-bottom: 0px solid rgba(218, 196, 125, 0.4);
    width: 100%;
}

.tb-drawer-host.open {
    max-height: 360px;
    border-bottom-width: 1px;
    overflow-y: auto;
}

.tb-drawer-inner {
    padding: 14px 16px;
    background: rgba(255, 253, 243, 0.98);
}

/* ── 5. Sticky shell — flex row, fills all remaining height ── */
.companion-sticky-shell {
    flex: 1 1 0;     /* takes all space left after drawer host */
    min-height: 0;   /* critical — allows flex child to shrink below content size */
    display: flex;
    overflow: hidden;
    width: 100%;
}

/* ── 6. Left column — scrolls independently ── */
.companion-scroll-region {
    flex: 1 1 0;
    min-width: 0;    /* prevents content from blowing out flex container */
    overflow-y: auto;
    padding: 2rem 2rem 4rem;
    scrollbar-width: thin;
    scrollbar-color: #d9cca0 transparent;
}

.companion-scroll-region::-webkit-scrollbar { width: 5px; }
.companion-scroll-region::-webkit-scrollbar-thumb {
    background: #d9cca0;
    border-radius: 3px;
}

/* ── 7. Right column — companion panel — NEVER moves ── */
.companion-sticky-panel {
    width: 340px;
    flex-shrink: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;   /* critical — clips children to panel bounds */
    border-left: 1px solid rgba(218, 196, 125, 0.5);
    background: rgba(255, 253, 243, 0.98);
}

/* ── 8. Panel header — pinned to top of panel ── */
.companion-sticky-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(218, 196, 125, 0.5);
    background: linear-gradient(135deg,
        rgba(255, 250, 222, 0.98) 0%,
        rgba(231, 246, 232, 0.96) 100%);
}

/* ── 9. Message thread — the ONLY scrolling part of the panel ── */
.companion-sticky-messages {
    flex: 1 1 0;     /* fills all space between header and chips/input */
    min-height: 0;   /* critical */
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    scrollbar-width: thin;
    scrollbar-color: #d9cca0 transparent;
}

.companion-sticky-messages::-webkit-scrollbar { width: 4px; }
.companion-sticky-messages::-webkit-scrollbar-thumb {
    background: #d9cca0;
    border-radius: 2px;
}

/* ── 10. Chips — pinned above input ── */
.companion-sticky-chips {
    flex-shrink: 0;
    padding: 0.6rem 0.9rem;
    border-top: 1px solid rgba(218, 196, 125, 0.35);
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

/* ── 11. Input row — pinned to bottom of panel, never moves ── */
.companion-sticky-input {
    flex-shrink: 0;
    padding: 0.75rem;
    border-top: 1px solid rgba(218, 196, 125, 0.45);
}

/* ── 12. Full view mode — companion fills full width ── */
.companion-sticky-shell.layout-full .companion-scroll-region {
    display: none;
}

.companion-sticky-shell.layout-full .companion-sticky-panel {
    width: 100%;
    border-left: none;
}

/* ── 13. Stat cards — fix overflow in narrow left column ── */
.companion-scroll-region .teacher-summary-row {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.companion-scroll-region .companion-primary-layout {
    grid-template-columns: 1fr;
}

.companion-scroll-region .companion-sidebar-stack {
    width: 100%;
    max-width: none;
}

.companion-plus-host {
    position: relative;
    flex-shrink: 0;
}

.companion-plus-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid #d8c88f;
    background: #fff9de;
    color: #7a6b32;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 100ms ease, transform 100ms ease;
}

.companion-plus-btn:hover {
    background: var(--gold-soft);
    border-color: var(--gold);
}

.companion-plus-btn.open {
    transform: rotate(45deg);
    background: var(--gold-soft);
}

.companion-plus-btn svg {
    width: 14px;
    height: 14px;
}

.companion-plus-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    background: rgba(255, 253, 243, 0.99);
    border: 1px solid #e4d8a5;
    border-radius: 18px;
    padding: 6px;
    box-shadow: 0 12px 32px rgba(120, 104, 34, 0.14);
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 180px;
    z-index: 50;
}

.companion-plus-menu[hidden] {
    display: none;
}

.companion-plus-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.8rem;
    border-radius: 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background 80ms ease;
    position: relative;
}

.companion-plus-item:hover {
    background: var(--leaf);
}

.companion-plus-item-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.companion-plus-item-label {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--ink);
}

.companion-plus-item-tip {
    display: none;
}

.chat-bubble-image img.chat-image-thumb {
    max-width: 100%;
    border-radius: 12px;
    margin-top: 0.5rem;
    border: 1px solid #e4d8a5;
}

.chat-divider {
    border: 0;
    border-top: 1px solid rgba(218, 196, 125, 0.65);
    margin: 0.85rem 0;
}

.transcription-card {
    border: 1px dashed rgba(109, 150, 95, 0.45);
}

.transcription-card-body {
    display: grid;
    gap: 0.85rem;
}

.transcription-text {
    padding: 0.9rem 1rem;
    border-radius: 14px;
    background: rgba(255, 252, 240, 0.92);
    border: 1px solid rgba(218, 196, 125, 0.45);
    line-height: 1.55;
    white-space: pre-wrap;
}

.transcription-card.editing .transcription-text {
    background: #fffef6;
    outline: 2px solid rgba(109, 150, 95, 0.28);
}

.transcription-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.transcription-action {
    min-height: 2.5rem;
}

.companion-drop-zone {
    position: absolute;
    inset: 0;
    z-index: 20;
    background: rgba(223, 244, 216, 0.92);
    border: 3px dashed var(--leaf-line);
    border-radius: 0;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.companion-sticky-panel.is-drag-target .companion-drop-zone {
    display: flex;
}

.companion-drop-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #2d5e27;
}

.companion-drop-hint span:first-child {
    font-size: 2.5rem;
}

.lil-canvas-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 400;
    background: rgba(31, 42, 31, 0.35);
    align-items: center;
    justify-content: center;
}

.lil-canvas-overlay.open {
    display: flex;
}

.lil-canvas-modal {
    background: rgba(255, 253, 243, 0.99);
    border: 1px solid #e4d8a5;
    border-radius: 28px;
    padding: 1.25rem;
    width: min(680px, calc(100vw - 2rem));
    max-height: calc(100vh - 4rem);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    box-shadow: 0 24px 56px rgba(120, 104, 34, 0.16);
}

.lil-canvas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lil-canvas-title {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ink);
}

.lil-canvas-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #d8c88f;
    background: #fff9de;
    color: #6c5a1a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.lil-canvas-tools {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.lil-canvas-tool-group {
    display: flex;
    gap: 4px;
}

.lil-canvas-tool {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1.5px solid transparent;
    background: #fffdf3;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 80ms ease;
}

.lil-canvas-tool:hover {
    background: var(--leaf);
    border-color: var(--leaf-line);
}

.lil-canvas-tool.active {
    background: var(--gold-soft);
    border-color: var(--gold);
}

.lil-canvas-colors {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.lil-canvas-color {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 80ms ease;
}

.lil-canvas-color:hover {
    transform: scale(1.15);
}

.lil-canvas-color.active {
    border-color: var(--ink);
    transform: scale(1.15);
}

.lil-canvas-color-white {
    border-color: #d9cca0;
}

.lil-canvas-size-slider {
    width: 80px;
    accent-color: #2d6e3a;
}

.lil-canvas-wrap {
    flex: 1;
    border-radius: 18px;
    border: 1px solid #e4d8a5;
    overflow: hidden;
    background: #fff;
    min-height: 300px;
    touch-action: none;
}

.lil-canvas-wrap canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.lil-canvas-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.lil-canvas-spacer {
    flex: 1;
}

@media (max-width: 600px) {
    .lil-canvas-modal {
        border-radius: 20px 20px 0 0;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 90vh;
    }

    .lil-canvas-overlay {
        align-items: flex-end;
    }
}

/* ── 14. Mobile — stack vertically ── */
@media (max-width: 900px) {
    .companion-page-main {
        height: auto;
        overflow: visible;
        width: 100%;
    }

    .companion-sticky-shell {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }

    .companion-sticky-panel {
        width: 100%;
        height: 480px;
        border-left: none;
        border-top: 1px solid rgba(218, 196, 125, 0.5);
        order: -1;
    }

    .companion-scroll-region {
        overflow-y: visible;
        padding: 1.25rem 1rem 2rem;
    }

    .app-toolbar {
        top: 0;
    }
}

/* ── Header / Nav / Footer fix pass — 2026-03-25 ── */
.app-header {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(14px);
    background: rgba(255, 252, 235, 0.84);
    border-bottom: 1px solid rgba(218, 196, 125, 0.45);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
}

.brandmark-block {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.app-toolbar-inner {
    width: min(1100px, calc(100% - 2rem));
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 0 5px;
    border-top: 1px solid rgba(218, 196, 125, 0.25);
}

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

.app-nav a {
    padding: 0;
    border-radius: 0;
}

.app-auth-nav {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-shrink: 0;
}

.nav-icon-btn {
    position: relative;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #566356;
    transition: background 100ms ease;
    flex-shrink: 0;
}

.nav-icon-btn:hover {
    background: rgba(255, 255, 255, 0.75);
}

.nav-icon-label-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #566356;
    transition: background 100ms ease;
    flex-shrink: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
}

.nav-icon-label-btn:hover {
    background: rgba(255, 255, 255, 0.75);
}

.nav-companion-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 1.2rem;
    transition: transform 120ms ease;
    flex-shrink: 0;
}

.nav-companion-btn:hover {
    transform: scale(1.12);
}

.nav-companion-emoji {
    line-height: 1;
}

.nav-svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-admin {
    width: 20px;
    height: 20px;
}

.nav-tooltip {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #1f2a1f;
    color: #fff;
    font-size: 0.68rem;
    padding: 4px 9px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 120ms ease;
    z-index: 100;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

.nav-icon-btn:hover .nav-tooltip,
.nav-icon-label-btn:hover .nav-tooltip,
.nav-companion-btn:hover .nav-tooltip {
    opacity: 1;
}

.nav-icon-btn[aria-current="page"],
.nav-icon-label-btn[aria-current="page"],
.nav-companion-btn[aria-current="page"] {
    background: rgba(255, 255, 255, 0.85);
    color: #2d6e3a;
}

.nav-signout-btn {
    font-weight: 600;
}

.app-footer {
    position: sticky;
    bottom: 0;
    z-index: 8;
    background: rgba(255, 252, 235, 0.95);
    border-top: 1px solid rgba(218, 196, 125, 0.35);
    padding: 0.4rem 0;
    color: #647364;
}

.app-footer .app-shell {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: nowrap;
}

.app-footer p {
    margin: 0;
    font-size: 0.82rem;
}

.app-version-label {
    font-size: 0.78rem;
    color: #7a876f;
    margin: 0;
}

@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.75rem 0;
    }

    .brandmark-block {
        flex: 1 0 auto;
    }

    .app-auth-nav {
        flex: 0 0 auto;
    }

    .app-nav {
        order: 3;
        width: 100%;
        flex-wrap: wrap;
        gap: 0.35rem;
        padding-bottom: 0.5rem;
    }

    .app-nav a {
        font-size: inherit;
    }

    .app-nav-learner .nav-companion-btn,
    .app-nav-learner .nav-icon-btn {
        width: 38px;
        height: 38px;
    }
}
