/* lil' bird — aged parchment (ChatGPT parchment set, 5 Nov).
 * Loaded LAST on Nest, Inner Compass-in-Nest, Solo and Solo tools.
 * Replaces the code-drawn torn edge with real paper:
 *  - big fixed-shape panels use whole sheets stretched once (sheet-*.webp)
 *  - every other panel uses the edge frame as a 9-slice (frame.webp), so
 *    corners keep their shape at any height, with a solid cream fill inside.
 * Paper stays light in both themes (approved concept).
 * Masters + notes: art-masters/parchment-v1/ (not published).
 */
:root {
  --pp-frame: url("/nest/assets/lilbird-kit/paper/frame.webp");
  --pp-hero: url("/nest/assets/lilbird-kit/paper/sheet-hero.webp");
  --pp-card: url("/nest/assets/lilbird-kit/paper/sheet-card.webp");
  --pp-rail: url("/nest/assets/lilbird-kit/paper/sheet-rail.webp");
  --pp-shadow: drop-shadow(0 12px 18px rgba(48, 32, 12, 0.22)) drop-shadow(0 2px 2px rgba(48, 32, 12, 0.14));
  --pp-fill: radial-gradient(130% 110% at 40% 30%, #fff6e6 0%, #fcefd9 55%, #f8e7c9 100%);
  --pf: 34px;
}
html[data-theme="dark"] { --pp-shadow: drop-shadow(0 16px 26px rgba(0, 0, 0, 0.5)) drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35)); }

/* ══ Whole sheets ══ */
:is(
  .nest-world .next-chapter,
  .nest-world #view-auth .auth-card,
  html.solo-journal .solo-landing-hero-copy,
  html.ic-nest #screen-results .result-header,
  .nest-world .nest-rail,
  .nest-world .nest-secondary-card
)::before {
  border-radius: 0 !important;
  background: var(--pp-hero) center / 100% 100% no-repeat !important;
  filter: var(--pp-shadow) !important;
  inset: 0 !important;
}
:is(
  .nest-world .next-chapter,
  .nest-world #view-auth .auth-card,
  html.solo-journal .solo-landing-hero-copy,
  html.ic-nest #screen-results .result-header,
  .nest-world .nest-rail,
  .nest-world .nest-secondary-card
)::after {
  /* solid backing under the sheet's near-opaque centre */
  content: "" !important;
  display: block !important;
  position: absolute !important;
  inset: 9% 6% !important;
  z-index: -2 !important;
  background: #fcecd6 !important;
  border-radius: 18px;
  pointer-events: none;
  opacity: 1 !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
}
.nest-world .nest-rail::before { background-image: var(--pp-rail) !important; }
.nest-world .nest-secondary-card::before { background-image: var(--pp-card) !important; }

/* ══ 9-slice frame for everything else ══ */
:is(
  .nest-world :is(.product-card, .lc-card, .journey-home, .journey-exercise, .guide-presence, .guide-talk, .nest-settings, .nest-letters-card, .sidebar-card, .plan-badge, .nest-mobile-more, .nest-tour-card),
  html.ic-nest #screen-results :is(.read-accordion, .insight-card, .canvas-hero-card, .role-reflection, .partner-section, .whats-next-panel, .sidebar-card, .nest-next-card, .ic-unlock),
  html.solo-journal :is(.complete-hero, .flight-plan-block, .session-card, .continue-panel, .sessions-archive, .chat-container, .session-info, .auth-card, .post-purchase-card, .gate-card, .deep-snapshot, .complete-panel, .purchase-gate, .solo-landing-section),
  html.solo-journal:not(.tool-embedded) .page
)::before {
  inset: 0 !important;
  border-radius: 0 !important;
  background: none !important;
  border-style: solid !important;
  border-color: transparent !important;
  border-width: var(--pf) !important;
  border-image: var(--pp-frame) 15% / var(--pf) / 0 stretch !important;
  filter: var(--pp-shadow) !important;
  z-index: -2 !important;
}
:is(
  .nest-world :is(.product-card, .lc-card, .journey-home, .journey-exercise, .guide-presence, .guide-talk, .nest-settings, .nest-letters-card, .sidebar-card, .plan-badge, .nest-mobile-more, .nest-tour-card),
  html.ic-nest #screen-results :is(.read-accordion, .insight-card, .canvas-hero-card, .role-reflection, .partner-section, .whats-next-panel, .sidebar-card, .nest-next-card, .ic-unlock),
  html.solo-journal :is(.complete-hero, .flight-plan-block, .session-card, .continue-panel, .sessions-archive, .chat-container, .session-info, .auth-card, .post-purchase-card, .gate-card, .deep-snapshot, .complete-panel, .purchase-gate, .solo-landing-section),
  html.solo-journal:not(.tool-embedded) .page
)::after {
  /* cream fill joins the frame's inner edge; softened so no seam shows */
  content: "" !important;
  display: block !important;
  position: absolute !important;
  inset: calc(var(--pf) * 0.7) !important;
  z-index: -1 !important;
  background: var(--pp-fill) !important;
  filter: blur(2.5px);
  border-radius: 6px;
  pointer-events: none;
  opacity: 1 !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
}

/* Smaller frames on small panels */
:is(.nest-world :is(.sidebar-card, .plan-badge, .nest-tour-card, .nest-mobile-more), html.ic-nest .sidebar-card, html.ic-nest .nest-next-card, html.solo-journal .session-card) { --pf: 24px; }
@media (max-width: 600px) { :root { --pf: 26px; } }

/* ══ Breathing room: text never reaches the torn edge ══ */
.nest-world .next-chapter { padding: 2.6rem 2.9rem 2.4rem !important; }
.nest-world .nest-rail { padding: 1.7rem 1.35rem 1.8rem 1.45rem !important; }
.nest-world .nest-secondary-card { padding: 1.7rem 1.9rem 1.9rem !important; }
.nest-world :is(.product-card, .lc-card, .journey-home, .journey-exercise, .guide-talk, .nest-letters-card, .nest-settings) { padding: 2.1rem 2.3rem 2.2rem !important; }
.nest-world :is(.sidebar-card, .guide-presence) { padding: 1.45rem 1.5rem 1.5rem !important; }
.nest-world .plan-badge { padding: 1.05rem 1.5rem 1.15rem !important; }
.nest-world .nest-tour-card { padding: 1.5rem 1.6rem 1.35rem !important; }
.nest-world #view-auth .auth-card { padding: 2.9rem 3rem 2.7rem !important; }

html.ic-nest #screen-results .result-header { padding: 2.6rem 2.9rem 2.4rem !important; }
html.ic-nest #screen-results :is(.read-accordion, .insight-card, .canvas-hero-card, .role-reflection, .partner-section, .whats-next-panel, .ic-unlock) { padding: 1.9rem 2.2rem 2rem !important; }
html.ic-nest #screen-results :is(.sidebar-card, .nest-next-card) { padding: 1.4rem 1.5rem !important; }

/* Solo: every panel gets real inner margin (the text-hugging fix) */
html.solo-journal :is(.complete-hero, .flight-plan-block, .continue-panel, .sessions-archive, .auth-card, .post-purchase-card, .gate-card, .deep-snapshot, .complete-panel, .purchase-gate) { padding: 2.1rem 2.4rem 2.2rem !important; }
html.solo-journal .session-card { padding: 1.4rem 1.6rem !important; }
html.solo-journal .session-info { padding: 2.2rem 2.3rem 2.3rem !important; }
html.solo-journal .solo-landing-hero-copy { padding: 2.8rem 3rem 2.5rem !important; }
html.solo-journal .solo-landing-section { padding: 2.4rem 2.8rem 2.6rem !important; }
html.solo-journal:not(.tool-embedded) .page { padding: 2.6rem 2.9rem 3rem !important; }
/* Chat keeps its full-height layout; the frame sits around it */
html.solo-journal .chat-container { padding: 1.1rem 1.25rem 1.15rem !important; }
html.solo-journal .chat-header { padding-left: 0.6rem !important; padding-right: 0.6rem !important; }
html.solo-journal .chat-messages { padding-left: 0.6rem !important; padding-right: 0.6rem !important; }
html.solo-journal .chat-input-wrap { padding-left: 0.4rem !important; padding-right: 0.4rem !important; }
html.solo-journal .session-archive-row { padding-left: 0.5rem !important; padding-right: 0.5rem !important; }

@media (max-width: 600px) {
  .nest-world .next-chapter { padding: 2.2rem 1.8rem 2rem !important; }
  .nest-world .nest-secondary-card { padding: 1.6rem 1.7rem 1.7rem !important; }
  .nest-world :is(.product-card, .lc-card, .journey-home, .journey-exercise, .guide-talk, .nest-letters-card, .nest-settings) { padding: 1.8rem 1.6rem 1.9rem !important; }
  .nest-world #view-auth .auth-card { padding: 2.4rem 1.9rem 2.2rem !important; }
  html.ic-nest #screen-results :is(.result-header, .read-accordion, .insight-card, .canvas-hero-card, .role-reflection, .partner-section, .whats-next-panel, .ic-unlock) { padding: 1.9rem 1.6rem !important; }
  html.solo-journal :is(.complete-hero, .flight-plan-block, .continue-panel, .sessions-archive, .auth-card, .post-purchase-card, .gate-card, .deep-snapshot, .complete-panel, .purchase-gate, .session-info, .solo-landing-hero-copy, .solo-landing-section) { padding: 1.9rem 1.6rem 2rem !important; }
  html.solo-journal:not(.tool-embedded) .page { padding: 2rem 1.55rem 2.3rem !important; }
}

/* Tools: the top row sits straight on the paper */
html.solo-journal .page > .nav { background: transparent !important; box-shadow: none !important; border: 0 !important; }
html.solo-journal .page > .nav .nav-left { background: transparent !important; }

/* Phone session bar: keep day/night, Session info and My sessions on one row */
@media (max-width: 600px) {
  html.solo-journal .session-nav #nav-back-nest-session { display: none !important; }
  html.solo-journal .session-nav > div:last-child { overflow: hidden; }
}

/* ── Nothing peeks out from behind the paper ── */
/* Sheet backings stay well inside the torn edge */
:is(
  .nest-world .next-chapter,
  .nest-world #view-auth .auth-card,
  html.solo-journal .solo-landing-hero-copy,
  html.ic-nest #screen-results .result-header,
  .nest-world .nest-rail,
  .nest-world .nest-secondary-card
)::after { inset: 18% 12% !important; }
/* Sidebar cards that carried their own tinted box */
html[data-theme] body.nest-world .side-col :is(.sidebar-card, .sidebar-card.ember, .sidebar-card.hint, details.sidebar-card),
html[data-theme] body.nest-world .sidebar-card :is(summary, details) {
  background: transparent !important;
  background-image: none !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

/* ── Nest Home desktop: one 24px rhythm, edges lined up ──
   menu | 24 | content; greeting and menu share a top line;
   chapter | 24 | card row; 24 between cards. */
@media (min-width: 981px) {
  .nest-world { --g: 24px; }
  .nest-world .nest-shell {
    grid-template-columns: 204px minmax(0, 1fr) !important;
    column-gap: var(--g) !important;
    padding: var(--g) 32px 0 var(--g) !important;
    align-items: start;
  }
  .nest-world .nest-rail { margin: 0 !important; top: 0 !important; align-self: start; width: 204px; box-sizing: border-box; }
  .nest-world .nest-dash { padding: 0 0 56px 0 !important; }
  .nest-world .nest-home-block { margin: 0 !important; }
  .nest-world .nest-greeting { margin: 0 0 16px !important; padding-top: 0 !important; }
  .nest-world .nest-home-stage { min-height: 0 !important; margin: 0 !important; }
  .nest-world .nest-secondary { margin: var(--g) 0 0 !important; gap: var(--g) !important; }
  /* Kids sit beside the chapter card, resting on the card row */
  .nest-world .nest-companions-stage {
    top: 92px !important;
    bottom: auto !important;
    right: 3vw !important;
    width: clamp(340px, 33vw, 500px) !important;
  }
}
@media (min-width: 981px) {
  /* Brand lives in the menu on desktop; the floating header keeps only the actions */
  .nest-world .nest-chrome .nest-brand { display: none !important; }
}

/* ── Solo session: left column scrolls inside itself, so the paper must be on
   the card itself (border-image frame + fill), not a ::before that scrolls
   away with the content. Video sized to fit; details + tools on cream slips. ── */
html.solo-journal .session-info::before,
html.solo-journal .session-info::after { content: none !important; display: none !important; }
html.solo-journal .session-info {
  border: 30px solid transparent !important;
  border-image: var(--pp-frame) 15% / 30px / 0 stretch !important;
  background: radial-gradient(130% 110% at 40% 25%, #fdf3e2 0%, #f9e9cd 70%, #f4ddba 100%) center / calc(100% - 26px) calc(100% - 26px) no-repeat border-box !important;
  padding: 1.4rem 1.6rem 1.6rem !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(169, 124, 63, 0.45) transparent;
}
html.solo-journal .session-info .video-wrap {
  width: min(100%, 240px) !important;
  height: auto !important;
  margin: 1.2rem auto 0 !important;
}
html.solo-journal .session-info .video-player-container {
  /* files are 1280x720 with a 9:16 portrait recording centred; frame the recording */
  aspect-ratio: 9 / 16;
  height: auto !important;
  max-height: 60vh;
  border-radius: 16px;
  overflow: hidden;
  margin: 0 auto;
}
html.solo-journal .session-info .video-player-container video { width: 100%; height: 100%; object-fit: cover; display: block; }
html.solo-journal .session-info :is(.session-meta-row, .tools-section) {
  background: rgba(240, 222, 184, 0.45) !important;
  border: 1px solid rgba(169, 124, 63, 0.22) !important;
  border-radius: 14px 10px 16px 12px !important;
  padding: 0.9rem 1rem !important;
  margin-top: 1rem !important;
}
html.solo-journal .session-info :is(.tools-label, .meta-label) { color: var(--honey) !important; }
html.solo-journal .session-info :is(.meta-value, .tool-item, .snap-bar-label) { color: var(--ink) !important; }
html.solo-journal .session-info-sheet-bar {
  background: transparent !important;
  border-bottom: 1px solid rgba(169, 124, 63, 0.22) !important;
}
html.solo-journal .session-info-sheet-bar .sheet-title { color: var(--honey) !important; }
html.solo-journal .btn-close-session-info {
  border-radius: 999px !important;
  background: rgba(255, 252, 244, 0.85) !important;
  border: 1px solid rgba(169, 124, 63, 0.35) !important;
  color: var(--ink) !important;
  font-family: "DM Sans", sans-serif !important;
  text-transform: none !important;
}

/* Scroll-back targets clear the sticky top bar. */
body.nest-world :is(.tab-pane, #pane-journey, .journey-note, #chat-messages, #chat-input) { scroll-margin-top: 88px; }

/* Career change entry points (Nest Home strip + Journey featured card) */
.nest-career-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 100%;
  margin: 1.1rem 0 0; padding: 0.95rem 1.3rem; text-align: left; cursor: pointer;
  background: rgba(255, 250, 238, 0.94); border: 1px solid rgba(138, 90, 23, 0.32);
  border-radius: 18px 14px 20px 16px; box-shadow: 0 8px 22px rgba(48, 32, 12, 0.16);
  color: #2a221b; font-family: "DM Sans", system-ui, sans-serif; font-size: 0.95rem; line-height: 1.4;
}
.nest-career-strip strong { font-weight: 700; }
.nest-career-strip-text span { color: #6b5d4c; font-size: 0.86rem; white-space: nowrap; }
.nest-career-strip-go { flex: 0 0 auto; background: #17485b; color: #fff9ef; border-radius: 999px; padding: 0.42rem 0.95rem; font-weight: 600; font-size: 0.88rem; }
.nest-career-strip:hover .nest-career-strip-go { background: #1f5b72; }
.nest-career-strip:focus-visible { outline: 2px solid #17485b; outline-offset: 3px; }
@media (max-width: 640px) { .nest-career-strip { flex-direction: column; align-items: flex-start; } .nest-career-strip-text span { white-space: normal; display: block; margin-top: 0.2rem; } }
.journey-featured {
  margin: 0.4rem 0 1.2rem; padding: 1rem 1.15rem; border-radius: 16px 12px 18px 14px;
  background: rgba(240, 222, 184, 0.45); border: 1px solid rgba(138, 90, 23, 0.28);
}
.journey-featured h4 { margin: 0.15rem 0 0.35rem; font-family: "Playfair Display", serif; font-style: italic; font-size: 1.2rem; color: #2a221b; }
.journey-featured p:not(.journey-kicker) { margin: 0 0 0.8rem; color: #3e342a; font-size: 0.92rem; line-height: 1.55; }

/* Guide: plain AI labelling and the 1:1 coaching card */
.guide-ai-note { font-size: 0.8rem; line-height: 1.45; color: #6b5d4c; margin: 0.4rem 0 0; }
.guide-composer-note { font-size: 0.74rem; color: #7a6d5d; margin: 0.45rem 0.2rem 0; }
.guide-stage.is-locked .guide-composer-note { display: none; }
a.guide-tool.guide-coaching { text-decoration: none; border-color: rgba(23, 72, 91, 0.45) !important; }
a.guide-tool.guide-coaching strong { color: #17485b; }
