/* =====================================================================
   180° Programme — design system
   PSC tokens + cinematic motion + signature 180° watermark
   ===================================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --black:   #0a0a0a;
  --black-2: #141414;
  --white:   #ffffff;
  --off:     #f5f5f3;
  --off-2:   #fafaf8;
  --border:  #e8e8e5;
  --muted:   #888880;
  --faint:   #d0d0cc;
  --accent:  #0a0a0a;
  --signal:  #0a0a0a; /* was warm gold — now black for pure black/white aesthetic */

  --f-display: 'Bebas Neue', 'Arial Narrow', sans-serif;
  --f-body:    'DM Sans', -apple-system, system-ui, sans-serif;

  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-in-out: cubic-bezier(.4, 0, .2, 1);
}

html { font-size: 16px; }
body {
  font-family: var(--f-body);
  background: var(--off);
  color: var(--black);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ============================  TYPE  ================================== */
.tag {
  font-size: 9px; letter-spacing: 0.3em; text-transform: uppercase;
  font-weight: 500; color: var(--muted);
}
.tag--white  { color: rgba(255,255,255,0.4); }
.tag--bright { color: rgba(255,255,255,0.8); }

/* =========================  CINEMATIC LOADING  ======================== */
.boot {
  position: fixed; inset: 0; z-index: 999;
  background: var(--black);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 28px;
  animation: bootOut 0.4s var(--ease-out) 0.1s forwards;
}
.boot.persistent { animation: none; }
.boot-logo {
  font-family: var(--f-display);
  font-size: clamp(80px, 16vw, 140px);
  color: var(--white); letter-spacing: 0.02em; line-height: 1;
  opacity: 0; transform: translateY(8px);
  animation: bootIn 0.6s var(--ease-out) 0.1s forwards;
}
.boot-line {
  width: 0; height: 1px; background: var(--white);
  animation: bootLine 0.7s var(--ease-out) 0.45s forwards;
}
.boot-tag {
  font-size: 9px; letter-spacing: 0.4em; text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  opacity: 0;
  animation: bootIn 0.5s var(--ease-out) 0.7s forwards;
}
@keyframes bootIn   { to { opacity: 1; transform: none; } }
@keyframes bootLine { to { width: 180px; } }
@keyframes bootOut  { to { opacity: 0; pointer-events: none; visibility: hidden; } }

/* =========================  LOGIN SCREEN  ============================ */
.login-screen {
  position: fixed; inset: 0;
  background: var(--black); z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  overflow: hidden;
}
/* Massive 180° watermark behind the form — barely visible */
.login-screen::before {
  content: "180°";
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -55%);
  font-family: var(--f-display);
  font-size: clamp(280px, 42vw, 720px);
  letter-spacing: -0.03em; line-height: 0.85;
  color: rgba(255,255,255,0.025);
  pointer-events: none; user-select: none;
  white-space: nowrap;
}
.login-box { width: 100%; max-width: 420px; text-align: center; position: relative; z-index: 1; }
.login-logo {
  font-family: var(--f-display); font-size: 72px;
  color: var(--white); letter-spacing: 0.02em; line-height: 1;
  margin-bottom: 4px;
}
.login-sub {
  font-size: 9px; letter-spacing: 0.35em; text-transform: uppercase;
  color: rgba(255,255,255,0.35); margin-bottom: 52px;
}
.login-label {
  font-size: 10px; letter-spacing: 0.25em; text-transform: uppercase;
  color: rgba(255,255,255,0.4); margin-bottom: 14px; display: block;
}
.login-input {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--white); font-family: var(--f-body);
  font-size: 16px; letter-spacing: 0.08em; text-align: center;
  padding: 18px 20px; outline: none;
  transition: border-color 0.2s;
  text-transform: uppercase;
}
.login-input::placeholder { color: rgba(255,255,255,0.2); letter-spacing: 0.15em; }
.login-input:focus { border-color: rgba(255,255,255,0.4); }
.login-btn {
  width: 100%; margin-top: 12px;
  background: var(--white); color: var(--black);
  border: none; padding: 18px;
  font-family: var(--f-body); font-size: 11px;
  letter-spacing: 0.25em; text-transform: uppercase;
  cursor: pointer; transition: background 0.2s, color 0.2s;
}
.login-btn:hover { background: rgba(255,255,255,0.85); }
.login-btn:disabled { background: rgba(255,255,255,0.3); cursor: not-allowed; }
.login-error {
  margin-top: 14px; font-size: 11px; color: #e57373;
  letter-spacing: 0.1em; opacity: 0; transition: opacity 0.3s;
  min-height: 16px;
}
.login-error.show { opacity: 1; }
.login-error.success { color: rgba(255,255,255,0.6); }
.login-note {
  margin-top: 48px; font-size: 10px; color: rgba(255,255,255,0.2);
  letter-spacing: 0.08em;
}
.login-demo {
  margin-top: 28px;
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}
.login-demo a {
  color: rgba(255,255,255,0.7);
  border-bottom: 1px solid rgba(255,255,255,0.25);
  padding-bottom: 1px; margin-left: 6px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.login-demo a:hover { color: var(--white); border-color: var(--white); }

/* ============================  NAV  =================================== */
.p-nav {
  background: var(--black); padding: 0 48px;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; position: sticky; top: 0; z-index: 50;
}
.p-nav-logo {
  font-family: var(--f-display); font-size: 28px;
  color: var(--white); letter-spacing: 0.04em;
  display: inline-flex; align-items: center;
}
.p-nav-right { display: flex; align-items: center; gap: 24px; }
.p-nav-name {
  font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.p-nav-logout {
  font-size: 10px; letter-spacing: 0.15em; text-transform: uppercase;
  color: rgba(255,255,255,0.25); cursor: pointer;
  background: none; border: none;
  font-family: var(--f-body); transition: color 0.2s;
}
.p-nav-logout:hover { color: rgba(255,255,255,0.6); }
.p-nav-admin {
  font-family: var(--f-body);
  font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase;
  color: rgba(255,255,255,0.85); text-decoration: none;
  border: 1px solid rgba(255,255,255,0.25);
  padding: 8px 14px;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.p-nav-admin:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.6);
  color: var(--white);
}

/* ========================  WELCOME HEADER  ============================ */
.p-welcome {
  background: var(--black);
  padding: 72px 48px 80px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: relative; overflow: hidden;
}
/* Signature 180° watermark behind the headline */
.p-welcome::after {
  content: "180°";
  position: absolute;
  right: -3%; top: 50%;
  transform: translateY(-58%);
  font-family: var(--f-display);
  font-size: clamp(240px, 32vw, 540px);
  letter-spacing: -0.04em; line-height: 0.85;
  color: rgba(255,255,255,0.035);
  pointer-events: none; user-select: none;
  white-space: nowrap;
}
.p-welcome-inner { position: relative; z-index: 1; }
.p-welcome-tag {
  font-size: 9px; letter-spacing: 0.3em; text-transform: uppercase;
  color: rgba(255,255,255,0.3); margin-bottom: 18px;
  opacity: 0; transform: translateY(6px);
  animation: rise 0.7s var(--ease-out) 0.05s forwards;
}
.p-welcome-name {
  font-family: var(--f-display);
  font-size: clamp(52px, 7vw, 92px);
  color: var(--white); line-height: 0.95; letter-spacing: 0.02em;
  opacity: 0; transform: translateY(8px);
  animation: rise 0.8s var(--ease-out) 0.18s forwards;
}
.p-welcome-name span.fade { color: rgba(255,255,255,0.25); }
.p-welcome-name .deg { color: var(--white); font-weight: 400; }
.p-welcome-sub {
  margin-top: 22px; font-size: 15px;
  color: rgba(255,255,255,0.45); line-height: 1.7;
  max-width: 520px; font-weight: 300;
  opacity: 0; transform: translateY(6px);
  animation: rise 0.7s var(--ease-out) 0.32s forwards;
}
@keyframes rise { to { opacity: 1; transform: none; } }

/* Decorative line beneath the welcome that draws in */
.p-welcome-line {
  position: relative; z-index: 1;
  width: 0; height: 1px;
  background: rgba(255,255,255,0.18);
  margin-top: 36px;
  animation: drawLine 1s var(--ease-out) 0.55s forwards;
}
@keyframes drawLine { to { width: 96px; } }

/* =========================  PILLARS GRID  ============================= */
.p-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  background: var(--border);
  padding: 2px;
}

.p-card {
  background: var(--white);
  padding: 48px;
  display: flex; flex-direction: column;
  gap: 0;
  transition: background 0.3s var(--ease-out), transform 0.3s var(--ease-out);
  position: relative; overflow: hidden;
  cursor: pointer;
  min-height: 320px;
  text-align: left;
  width: 100%;
  border: 0;
  font-family: var(--f-body);
  opacity: 0; transform: translateY(12px);
  animation: rise 0.7s var(--ease-out) forwards;
}
.p-card:nth-child(1) { animation-delay: 0.05s; }
.p-card:nth-child(2) { animation-delay: 0.12s; }
.p-card:nth-child(3) { animation-delay: 0.19s; }
.p-card:nth-child(4) { animation-delay: 0.26s; }
.p-card:nth-child(5) { animation-delay: 0.33s; }
.p-card:nth-child(6) { animation-delay: 0.40s; }

/* Top hairline that draws in on hover */
.p-card::before {
  content: "";
  position: absolute; left: 0; top: 0;
  height: 2px; width: 0;
  background: var(--black);
  transition: width 0.5s var(--ease-out);
}
.p-card:hover:not(.is-locked)::before { width: 100%; }
.p-card:hover:not(.is-locked) { background: var(--off-2); }
.p-card.is-locked { cursor: default; }
.p-card.is-locked .p-card-num,
.p-card.is-locked .p-card-title { color: var(--faint); }

.p-card-num {
  font-family: var(--f-display);
  font-size: 96px; color: var(--border);
  line-height: 1; letter-spacing: -0.02em;
  margin-bottom: -4px;
  transition: color 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}
.p-card:hover:not(.is-locked) .p-card-num { color: var(--black); transform: translateX(-2px); }

.p-card-tag {
  font-size: 9px; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 18px;
  display: inline-flex; align-items: center; gap: 8px;
}
.p-card-tag.is-active { color: var(--black); }
.p-card-tag.is-done   { color: var(--black); }
.p-card-tag .dot {
  width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}
.p-card-tag.is-active .dot {
  background: var(--signal);
  box-shadow: 0 0 0 0 rgba(10,10,10,0.4);
  animation: pulseDot 2s var(--ease-out) infinite;
}
@keyframes pulseDot {
  0%   { box-shadow: 0 0 0 0 rgba(10,10,10,0.4); }
  70%  { box-shadow: 0 0 0 6px rgba(10,10,10,0); }
  100% { box-shadow: 0 0 0 0 rgba(10,10,10,0); }
}

.p-card-title {
  font-family: var(--f-display);
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1; letter-spacing: 0.02em;
  color: var(--black); margin-bottom: 14px;
}
.p-card-desc {
  font-size: 14px; color: var(--muted);
  line-height: 1.75; font-weight: 300; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

.p-card-foot {
  margin-top: 28px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.p-card-cta {
  font-size: 10px; letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--black); display: inline-flex; align-items: center; gap: 10px;
  transition: gap 0.25s var(--ease-out);
}
.p-card.is-locked .p-card-cta { color: var(--faint); }
.p-card:hover:not(.is-locked) .p-card-cta { gap: 16px; }
.p-card-cta .arrow { width: 14px; height: 1px; background: currentColor; position: relative; }
.p-card-cta .arrow::after {
  content: ""; position: absolute; right: -1px; top: -3px;
  width: 7px; height: 7px;
  border-top: 1px solid currentColor; border-right: 1px solid currentColor;
  transform: rotate(45deg);
}
.p-card-prog {
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted);
}
.p-card-bar {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px; background: rgba(10,10,10,0.04);
}
.p-card-bar-fill { height: 100%; background: var(--black); width: 0%; transition: width 1s var(--ease-out); }

/* The Library — distinct treatment on the dashboard */
.p-card.is-library {
  background: var(--black);
  color: var(--white);
}
.p-card.is-library .p-card-num { color: rgba(255,255,255,0.10); }
.p-card.is-library:hover:not(.is-locked) { background: var(--black-2); }
.p-card.is-library:hover:not(.is-locked) .p-card-num { color: rgba(255,255,255,0.18); transform: translateX(-2px); }
.p-card.is-library::before { background: var(--signal); }
.p-card.is-library .p-card-title { color: var(--white); }
.p-card.is-library .p-card-desc  { color: rgba(255,255,255,0.45); }
.p-card.is-library .p-card-tag,
.p-card.is-library .p-card-tag.is-library { color: var(--signal); }
.p-card.is-library .p-card-cta   { color: var(--white); }
.p-card.is-library .p-card-prog  { color: rgba(255,255,255,0.4); }
.p-card.is-library .p-card-tag .dot { background: var(--signal); box-shadow: 0 0 0 0 rgba(10,10,10,0.4); animation: pulseDot 2s var(--ease-out) infinite; }

/* ===========================  FOOTER  ================================= */
.p-footer {
  padding: 28px 48px;
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--border);
  background: var(--white);
}
.p-footer-logo {
  font-family: var(--f-display); font-size: 18px; color: var(--muted);
  letter-spacing: 0.04em;
}
.p-footer-text {
  font-size: 10px; color: var(--faint); letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* =========================  PILLAR PAGE  ============================== */
.p-back {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 10px; letter-spacing: 0.25em; text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 32px;
  transition: color 0.2s;
}
.p-back:hover { color: rgba(255,255,255,0.85); }
.p-back .arrow-back { width: 14px; height: 1px; background: currentColor; position: relative; }
.p-back .arrow-back::before {
  content: ""; position: absolute; left: -1px; top: -3px;
  width: 7px; height: 7px;
  border-top: 1px solid currentColor; border-left: 1px solid currentColor;
  transform: rotate(-45deg);
}

.p-pillar-head {
  display: grid; grid-template-columns: auto 1fr; gap: 36px; align-items: end;
  position: relative; z-index: 1;
}
.p-pillar-head-num {
  font-family: var(--f-display);
  font-size: clamp(96px, 12vw, 180px);
  color: rgba(255,255,255,0.10);
  line-height: 0.85; letter-spacing: -0.03em;
}
.p-pillar-head-body { color: var(--white); }
.p-pillar-head-tag {
  font-size: 9px; letter-spacing: 0.3em; text-transform: uppercase;
  color: rgba(255,255,255,0.35); margin-bottom: 14px; display: block;
}
.p-pillar-head h1 {
  font-family: var(--f-display);
  font-size: clamp(40px, 6vw, 80px);
  line-height: 0.95; letter-spacing: 0.02em;
  color: var(--white); font-weight: 400;
}
.p-pillar-head-sub {
  margin-top: 22px; font-size: 15px;
  color: rgba(255,255,255,0.45); line-height: 1.7;
  max-width: 640px; font-weight: 300;
}

/* Body container */
.p-section {
  background: var(--white);
  padding: 56px 48px;
}

.p-2col {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
  gap: 56px;
}
@media (max-width: 960px) { .p-2col { grid-template-columns: 1fr; gap: 36px; } }

/* Theatre mode — hides the sidebar so video can take full width */
body.theatre .p-2col { grid-template-columns: 1fr; }
body.theatre .lessons-side { display: none; }
body.theatre .p-section    { padding: 32px 28px; max-width: 1400px; margin: 0 auto; }

/* Video frame ---------------------------------------------------------- */
.video-wrap { position: relative; }
.video-frame {
  background: #000; aspect-ratio: 16 / 9;
  width: 100%; position: relative;
  border: 1px solid var(--border);
  overflow: hidden;
}
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-empty {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.4);
  font-size: 11px; letter-spacing: 0.25em; text-transform: uppercase;
  background: #0a0a0a;
}

.video-controls {
  position: absolute; top: 12px; right: 12px;
  display: flex; gap: 8px;
  opacity: 0;
  transition: opacity 0.2s var(--ease-out);
  z-index: 2;
}
.video-wrap:hover .video-controls,
body.theatre .video-controls { opacity: 1; }
.video-ctrl {
  background: rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.18);
  color: var(--white); width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-family: var(--f-body); font-size: 11px;
  letter-spacing: 0.18em; text-transform: uppercase;
  transition: background 0.15s, transform 0.15s;
}
.video-ctrl:hover { background: rgba(0,0,0,0.85); transform: scale(1.04); }
.video-ctrl svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.5; }

/* Lesson meta ---------------------------------------------------------- */
.lesson-meta {
  margin-top: 32px;
  display: flex; align-items: baseline; gap: 22px; flex-wrap: wrap;
}
.lesson-title {
  font-family: var(--f-display);
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1; letter-spacing: 0.02em;
  color: var(--black); font-weight: 400;
}
.lesson-duration {
  font-size: 10px; letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--muted);
}
.lesson-desc {
  margin-top: 14px; color: var(--muted);
  font-size: 14px; line-height: 1.75; font-weight: 300;
  max-width: 700px;
}

.complete-btn {
  margin-top: 32px;
  background: var(--black); color: var(--white);
  border: none; padding: 18px 28px;
  font-family: var(--f-body); font-size: 11px;
  letter-spacing: 0.25em; text-transform: uppercase;
  cursor: pointer; transition: background 0.2s, transform 0.15s;
  display: inline-flex; align-items: center; gap: 12px;
}
.complete-btn:hover { background: var(--black-2); transform: translateY(-1px); }
.complete-btn[disabled] { opacity: 0.5; cursor: wait; }
.complete-btn.is-done { background: var(--white); color: var(--black); border: 1px solid var(--border); }
.complete-btn.is-done:hover { background: var(--off); }
.complete-btn .check {
  display: inline-block; width: 12px; height: 12px;
  border: 1px solid currentColor; position: relative;
}
.complete-btn.is-done .check { background: var(--black); border-color: var(--black); }
.complete-btn.is-done .check::after {
  content: ""; position: absolute; inset: 1px;
  background:
    linear-gradient(45deg,  transparent 45%, var(--white) 45%, var(--white) 55%, transparent 55%) center/100% 1.5px no-repeat,
    linear-gradient(-45deg, transparent 45%, var(--white) 45%, var(--white) 55%, transparent 55%) center/1.5px 100% no-repeat;
}

/* =========================  NOTES PANEL  ============================== */
.notes-block {
  margin-top: 56px;
  border-top: 1px solid var(--border);
  padding-top: 36px;
}
.notes-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.notes-title {
  font-family: var(--f-display); font-size: 22px; letter-spacing: 0.04em;
  color: var(--black);
}
.notes-status {
  font-size: 9px; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--muted);
  display: inline-flex; align-items: center; gap: 8px;
  transition: color 0.3s, opacity 0.3s;
}
.notes-status .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.notes-status.is-saving { color: var(--muted); }
.notes-status.is-saved  { color: var(--signal); }
.notes-status.is-saved .dot { background: var(--signal); }

.notes-input {
  width: 100%; min-height: 200px;
  padding: 22px 24px;
  font-family: var(--f-body); font-size: 15px;
  color: var(--black); background: var(--off);
  border: 1px solid var(--border);
  outline: none; resize: vertical;
  line-height: 1.7;
  transition: border-color 0.2s, background 0.2s;
}
.notes-input::placeholder { color: var(--faint); font-style: italic; }
.notes-input:focus { border-color: var(--black); background: var(--white); }

.notes-help {
  margin-top: 10px;
  font-size: 10px; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--faint);
}

/* =====================  LESSON SIDEBAR  ============================== */
.lessons-side h3 {
  font-family: var(--f-body); font-weight: 500;
  font-size: 9px; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 18px;
}
.lesson-item {
  display: grid; grid-template-columns: 28px 1fr auto;
  gap: 14px; align-items: center;
  padding: 18px 12px;
  margin: 0 -12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: padding 0.2s, background 0.2s;
}
.lesson-item:first-of-type { border-top: 1px solid var(--border); }
.lesson-item:hover { background: var(--off); }
.lesson-item.is-active { background: var(--off); }
.lesson-item.is-active::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--black);
}
.lesson-item-num {
  font-family: var(--f-display); font-size: 22px;
  color: var(--faint); letter-spacing: 0.04em;
}
.lesson-item.is-active .lesson-item-num,
.lesson-item.is-done   .lesson-item-num { color: var(--black); }
.lesson-item-title { font-size: 14px; color: var(--black); line-height: 1.3; font-weight: 400; }
.lesson-item-dur { font-size: 10px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.lesson-item-check {
  width: 14px; height: 14px; border: 1px solid var(--faint);
  display: inline-block; position: relative; flex-shrink: 0;
}
.lesson-item.is-done .lesson-item-check { background: var(--black); border-color: var(--black); }
.lesson-item.is-done .lesson-item-check::after {
  content: ""; position: absolute; inset: 2px;
  background:
    linear-gradient(45deg,  transparent 45%, var(--white) 45%, var(--white) 55%, transparent 55%) center/100% 1.5px no-repeat,
    linear-gradient(-45deg, transparent 45%, var(--white) 45%, var(--white) 55%, transparent 55%) center/1.5px 100% no-repeat;
}

/* ==========================  STATES  ================================= */
.empty {
  background: var(--white); padding: 60px 48px; text-align: center;
  border: 1px dashed var(--border);
}
.empty .tag    { display: block; margin-bottom: 12px; color: var(--muted); }
.empty .title  { font-family: var(--f-display); font-size: 32px; color: var(--black); margin-bottom: 8px; letter-spacing: 0.02em; }
.empty .copy   { font-size: 14px; color: var(--muted); font-weight: 300; }

.loading-shell {
  min-height: 60vh;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  font-size: 11px; letter-spacing: 0.25em; text-transform: uppercase;
}

/* =====================  RACHEL 2.0 HELP AGENT  ======================== */
.help-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 60;
  background: var(--black); color: var(--white);
  border: 1px solid var(--black);
  padding: 14px 18px;
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--f-body); font-size: 11px;
  letter-spacing: 0.22em; text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.2s var(--ease-out), background 0.2s;
  box-shadow: 0 12px 36px rgba(10,10,10,0.18);
}
.help-fab:hover { transform: translateY(-2px); background: var(--black-2); }
.help-fab .help-fab-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 0 rgba(10,10,10,0.4);
  animation: pulseDot 2s var(--ease-out) infinite;
}

.help-panel {
  position: fixed; right: 24px; bottom: 24px;
  width: 420px; max-width: calc(100vw - 24px);
  height: 600px; max-height: calc(100vh - 48px);
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: 0 24px 64px rgba(10,10,10,0.18);
  z-index: 70;
  display: none;
  flex-direction: column;
  overflow: hidden;
  opacity: 0; transform: translateY(12px);
  transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}
.help-panel.open { display: flex; }
.help-panel.shown { opacity: 1; transform: none; }

.help-head {
  background: var(--black); color: var(--white);
  padding: 22px 24px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.help-head-title {
  font-family: var(--f-display); font-size: 22px;
  letter-spacing: 0.04em;
  display: inline-flex; align-items: center; gap: 10px;
}
.help-head-title .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 0 rgba(10,10,10,0.4);
  animation: pulseDot 2s var(--ease-out) infinite;
}
.help-close {
  background: none; border: none; color: rgba(255,255,255,0.5);
  font-size: 22px; line-height: 1; cursor: pointer;
  transition: color 0.2s;
}
.help-close:hover { color: var(--white); }
.help-context {
  background: var(--black-2); color: rgba(255,255,255,0.55);
  padding: 12px 24px;
  font-size: 9px; letter-spacing: 0.22em; text-transform: uppercase;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.help-thread {
  flex: 1; overflow-y: auto;
  padding: 24px;
  display: flex; flex-direction: column; gap: 16px;
  background: var(--off);
}
.help-msg {
  max-width: 85%; padding: 12px 16px;
  font-size: 14px; line-height: 1.55;
  font-weight: 300;
}
.help-msg.user {
  align-self: flex-end;
  background: var(--black); color: var(--white);
}
.help-msg.agent {
  align-self: flex-start;
  background: var(--white); color: var(--black);
  border: 1px solid var(--border);
}
.help-msg-name {
  font-size: 9px; letter-spacing: 0.25em; text-transform: uppercase;
  margin-bottom: 6px; color: var(--muted);
}
.help-msg.user .help-msg-name { color: rgba(255,255,255,0.5); }
.help-typing {
  align-self: flex-start; padding: 14px 16px;
  background: var(--white); border: 1px solid var(--border);
  display: inline-flex; gap: 4px;
}
.help-typing-dot {
  width: 5px; height: 5px; border-radius: 50%; background: var(--muted);
  animation: typing 1.2s infinite;
}
.help-typing-dot:nth-child(2) { animation-delay: 0.15s; }
.help-typing-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing {
  0%, 60%, 100% { opacity: 0.2; }
  30% { opacity: 1; }
}

.help-form {
  display: grid; grid-template-columns: 1fr auto;
  border-top: 1px solid var(--border); background: var(--white);
}
.help-input {
  border: 0; outline: 0;
  padding: 16px 20px;
  font-family: var(--f-body); font-size: 14px;
  color: var(--black); background: transparent;
  resize: none; min-height: 56px; max-height: 120px;
}
.help-input::placeholder { color: var(--faint); }
.help-send {
  background: var(--black); color: var(--white);
  border: 0; padding: 0 22px;
  font-family: var(--f-body); font-size: 11px;
  letter-spacing: 0.22em; text-transform: uppercase;
  cursor: pointer; transition: background 0.2s;
}
.help-send:hover:not(:disabled) { background: var(--black-2); }
.help-send:disabled { opacity: 0.4; cursor: not-allowed; }

@media (max-width: 520px) {
  .help-fab    { right: 16px; bottom: 16px; padding: 12px 14px; }
  .help-panel  { right: 8px; bottom: 8px; width: calc(100vw - 16px); height: calc(100vh - 16px); }
}

/* =====================  THE LIBRARY (resources)  ====================== */

/* Hero block when in Library mode — slightly taller, more reverent */
.lib-hero-tag {
  font-size: 9px; letter-spacing: 0.3em; text-transform: uppercase;
  color: rgba(255,255,255,0.45); margin-top: 18px;
  display: inline-flex; align-items: center; gap: 12px;
}
.lib-hero-tag .lib-count {
  font-family: var(--f-display); font-size: 22px; letter-spacing: 0.04em;
  color: var(--white);
}

/* Section dividers inside The Library */
.lib-section { padding: 56px 48px; background: var(--white); }
.lib-section + .lib-section { padding-top: 0; }
.lib-section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.lib-section-title {
  font-family: var(--f-display);
  font-size: clamp(28px, 3vw, 40px);
  letter-spacing: 0.02em; line-height: 1;
}
.lib-section-meta {
  font-size: 9px; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--muted);
}

/* Pinterest-ish grid for resource cards */
.lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

/* WALKTHROUGHS — video sub-grid (uses mini-player cards) */
.lib-walkthroughs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}
.walk-card {
  background: var(--white); border: 1px solid var(--border);
  cursor: pointer; transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.walk-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(10,10,10,0.10); }
.walk-thumb {
  position: relative; aspect-ratio: 16/9; background: var(--black);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.walk-thumb::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(10,10,10,0.06), transparent 60%);
}
.walk-play {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--white); color: var(--black);
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 1;
  transition: transform 0.3s var(--ease-out), background 0.3s;
}
.walk-card:hover .walk-play { transform: scale(1.08); background: var(--signal); }
.walk-play::after {
  content: ""; display: inline-block; margin-left: 4px;
  border-style: solid; border-width: 9px 0 9px 14px;
  border-color: transparent transparent transparent currentColor;
}
.walk-num {
  position: absolute; top: 14px; left: 16px;
  font-family: var(--f-display); font-size: 24px; letter-spacing: 0.04em;
  color: rgba(255,255,255,0.55);
}
.walk-dur {
  position: absolute; bottom: 14px; right: 14px;
  background: rgba(0,0,0,0.7); padding: 4px 10px;
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--white);
}
.walk-meta { padding: 18px 20px 22px; }
.walk-title {
  font-family: var(--f-display); font-size: 20px; letter-spacing: 0.02em;
  margin-bottom: 6px;
}
.walk-desc {
  font-size: 13px; color: var(--muted); line-height: 1.6;
  font-weight: 300;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ============================================================
   LESSON GRID — standard pillar landing
   ============================================================ */
.lgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.lcard {
  background: var(--white); border: 1px solid var(--border);
  cursor: pointer; overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}
.lcard:not(.is-locked):hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(10,10,10,0.10); }
.lcard-thumb {
  position: relative; aspect-ratio: 16/9; background: var(--black);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.lcard-thumb::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 42%, rgba(255,255,255,0.07), transparent 62%);
}
.lcard-num {
  position: absolute; top: 12px; left: 14px;
  font-family: var(--f-display); font-size: 22px; letter-spacing: 0.04em;
  color: rgba(255,255,255,0.5);
}
.lcard-play {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--white); color: var(--black);
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 1;
  transition: transform 0.3s var(--ease-out), background 0.3s;
}
.lcard:hover .lcard-play { transform: scale(1.08); background: var(--signal); }
.lcard-play::after {
  content: ""; margin-left: 4px;
  border-style: solid; border-width: 8px 0 8px 13px;
  border-color: transparent transparent transparent currentColor;
}
.lcard-dur {
  position: absolute; bottom: 12px; right: 12px;
  background: rgba(0,0,0,0.7); padding: 4px 9px;
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--white);
}
.lcard-done {
  position: absolute; bottom: 12px; left: 12px;
  background: var(--white); color: var(--black); padding: 4px 9px;
  font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase;
}
.lcard-meta { padding: 16px 18px 20px; }
.lcard-title {
  font-family: var(--f-display); font-size: 19px; letter-spacing: 0.02em; line-height: 1.12;
  color: var(--black); margin-bottom: 6px;
}
.lcard-status {
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted);
}

/* Locked lessons — not uploaded yet */
.lcard.is-locked { cursor: default; }
.lcard.is-locked .lcard-thumb { background: #18181a; }
.lcard.is-locked .lcard-title { color: var(--muted); }
.lcard-lock {
  position: relative; z-index: 1; width: 30px; height: 46px; opacity: 0.55;
}
.lcard-lock::before { /* shackle */
  content: ""; position: absolute; left: 50%; top: 2px; transform: translateX(-50%);
  width: 20px; height: 18px;
  border: 3px solid rgba(255,255,255,0.65); border-bottom: 0; border-radius: 11px 11px 0 0;
}
.lcard-lock::after { /* body */
  content: ""; position: absolute; left: 50%; top: 18px; transform: translateX(-50%);
  width: 30px; height: 24px; background: rgba(255,255,255,0.65); border-radius: 4px;
}

/* Locked rows in the detail-view sidebar */
.lesson-item.is-locked { cursor: default; opacity: 0.55; }
.lesson-item.is-locked:hover { background: transparent; }

/* Back-to-lessons button (detail view) */
.p-back-lessons {
  display: inline-flex; align-items: center; gap: 9px;
  background: none; border: 0; cursor: pointer; padding: 0;
  margin-bottom: 30px;
  font-family: var(--f-body); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--muted); transition: color 0.2s;
}
.p-back-lessons:hover { color: var(--black); }

/* ============================================================
   LESSON PAGE — text content + downloads
   ============================================================ */
.lesson-prose {
  margin: 32px 0 8px;
  max-width: 64ch;
  color: var(--black);
  font-size: 16px; font-weight: 300; line-height: 1.75;
}
.lesson-prose h2 {
  font-family: var(--f-display); font-size: 28px; letter-spacing: 0.02em;
  margin: 34px 0 12px; line-height: 1.05;
}
.lesson-prose h3 {
  font-family: var(--f-display); font-size: 21px; letter-spacing: 0.03em;
  margin: 26px 0 10px;
}
.lesson-prose p { margin: 0 0 16px; }
.lesson-prose strong { font-weight: 500; }
.lesson-prose ul { margin: 0 0 18px; padding-left: 20px; }
.lesson-prose li { margin: 0 0 8px; }
.lesson-prose a { color: var(--black); text-decoration: underline; text-underline-offset: 3px; }
.lesson-prose a:hover { opacity: 0.6; }

/* Downloads list (lesson sidebar) */
.dl-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 36px; }
.dl-row {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: var(--white); border: 1px solid var(--border); padding: 14px 16px;
  cursor: pointer; font-family: var(--f-body);
  transition: border-color 0.2s, transform 0.2s var(--ease-out), box-shadow 0.2s;
}
.dl-row:hover { border-color: var(--black); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(10,10,10,0.08); }
.dl-type {
  flex: 0 0 auto; align-self: flex-start;
  background: var(--black); color: var(--white);
  font-size: 9px; letter-spacing: 0.14em; padding: 5px 7px;
}
.dl-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.dl-title { font-size: 14px; color: var(--black); line-height: 1.3; }
.dl-desc {
  font-size: 12px; color: var(--muted); font-weight: 300; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.dl-meta { font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); margin-top: 3px; }
.dl-icon {
  flex: 0 0 auto; width: 16px; height: 16px; position: relative; opacity: 0.5;
  transition: opacity 0.2s;
}
.dl-row:hover .dl-icon { opacity: 1; }
.dl-icon::before { /* down arrow shaft */
  content: ""; position: absolute; left: 50%; top: 1px; transform: translateX(-50%);
  width: 2px; height: 11px; background: var(--black);
}
.dl-icon::after { /* arrow head */
  content: ""; position: absolute; left: 50%; top: 6px; transform: translateX(-50%) rotate(45deg);
  width: 7px; height: 7px; border-right: 2px solid var(--black); border-bottom: 2px solid var(--black);
}
.dl-row.is-saved { border-color: var(--black); }
.dl-row.is-saved .dl-icon::before { display: none; }
.dl-row.is-saved .dl-icon::after {
  top: 2px; width: 5px; height: 9px; transform: translateX(-50%) rotate(45deg);
}

/* ============================================================
   DASHBOARD ACTIONS — Book a call
   ============================================================ */
.p-welcome-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 4px; }
.p-action-btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--f-body); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  padding: 13px 22px; cursor: pointer; border: 1px solid var(--black);
  background: var(--white); color: var(--black);
  transition: background 0.25s var(--ease-out), color 0.25s, transform 0.2s var(--ease-out);
}
.p-action-btn:hover { transform: translateY(-2px); }
.p-action-btn.is-primary { background: var(--black); color: var(--white); }
.p-action-btn.is-primary:hover { background: #000; }
.p-action-ico {
  display: inline-block; width: 16px; height: 16px; flex: 0 0 auto;
  background: currentColor;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-size: contain; mask-size: contain;
}
.ico-cal {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%3E%3Crect%20x='3'%20y='4.5'%20width='18'%20height='16'%20rx='2'/%3E%3Cline%20x1='3'%20y1='9'%20x2='21'%20y2='9'/%3E%3Cline%20x1='8'%20y1='2.5'%20x2='8'%20y2='6'/%3E%3Cline%20x1='16'%20y1='2.5'%20x2='16'%20y2='6'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%3E%3Crect%20x='3'%20y='4.5'%20width='18'%20height='16'%20rx='2'/%3E%3Cline%20x1='3'%20y1='9'%20x2='21'%20y2='9'/%3E%3Cline%20x1='8'%20y1='2.5'%20x2='8'%20y2='6'/%3E%3Cline%20x1='16'%20y1='2.5'%20x2='16'%20y2='6'/%3E%3C/svg%3E");
}

/* Booking popup */
.book-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(10,10,10,0.6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; transition: opacity 0.25s var(--ease-out);
}
.book-overlay.is-open { opacity: 1; }
.book-modal {
  background: var(--white); width: 100%; max-width: 880px; height: min(88vh, 760px);
  display: flex; flex-direction: column; overflow: hidden;
  transform: translateY(14px) scale(0.99); transition: transform 0.3s var(--ease-out);
  box-shadow: 0 40px 120px rgba(0,0,0,0.4);
}
.book-overlay.is-open .book-modal { transform: translateY(0) scale(1); }
.book-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; border-bottom: 1px solid var(--border); flex: 0 0 auto;
}
.book-modal-tag { font-size: 10px; letter-spacing: 0.25em; color: var(--muted); display: block; margin-bottom: 4px; }
.book-modal-title { font-family: var(--f-display); font-size: 24px; letter-spacing: 0.02em; }
.book-modal-close {
  background: none; border: 0; font-size: 30px; line-height: 1; cursor: pointer;
  color: var(--muted); font-family: var(--f-body); transition: color 0.2s;
}
.book-modal-close:hover { color: var(--black); }
.book-modal-body { flex: 1; min-height: 0; position: relative; background: var(--off); }
.book-modal-body iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.book-placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 40px; gap: 14px;
}
.book-placeholder-ico { width: 56px; height: 56px; background: var(--faint); }
.book-placeholder-title { font-family: var(--f-display); font-size: 26px; letter-spacing: 0.02em; }
.book-placeholder-copy { max-width: 420px; color: var(--muted); font-size: 14px; font-weight: 300; line-height: 1.6; }
.book-placeholder-note { font-size: 11px; letter-spacing: 0.1em; color: var(--faint); margin-top: 6px; }
.book-placeholder-note code { background: var(--white); border: 1px solid var(--border); padding: 2px 6px; color: var(--muted); }
@media (max-width: 600px) { .book-modal { height: 92vh; max-width: 100%; } .book-modal-title { font-size: 20px; } }

.ico-msg {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M21%2011.5a8.38%208.38%200%200%201-8.5%208.5%208.5%208.5%200%200%201-3.8-.9L3%2021l1.9-5.7a8.5%208.5%200%200%201-.9-3.8A8.38%208.38%200%200%201%2012.5%203%208.38%208.38%200%200%201%2021%2011.5z'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M21%2011.5a8.38%208.38%200%200%201-8.5%208.5%208.5%208.5%200%200%201-3.8-.9L3%2021l1.9-5.7a8.5%208.5%200%200%201-.9-3.8A8.38%208.38%200%200%201%2012.5%203%208.38%208.38%200%200%201%2021%2011.5z'/%3E%3C/svg%3E");
}
.p-action-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; margin-left: 2px;
  background: #d23; color: #fff; border-radius: 9px;
  font-size: 10px; letter-spacing: 0; font-weight: 500;
}
.p-action-badge[hidden] { display: none; }
/* Critical: these full-screen overlays use display:flex, which overrides the
   [hidden] attribute. Without this they sit invisibly over the whole page and
   block every click. Keep this rule. */
.book-overlay[hidden], .msg-overlay[hidden] { display: none !important; }

/* ============================================================
   ANNOUNCEMENTS (broadcasts) — dashboard
   ============================================================ */
.p-ann { max-width: 1200px; margin: 0 auto; padding: 8px 48px 0; }
.p-ann-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.p-ann-title { font-family: var(--f-display); font-size: 22px; letter-spacing: 0.04em; }
.p-ann-clear {
  background: none; border: 0; cursor: pointer; color: var(--muted);
  font-family: var(--f-body); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
}
.p-ann-clear:hover { color: var(--black); }
.p-ann-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.p-ann-card {
  position: relative; background: var(--white); border: 1px solid var(--border);
  padding: 18px 20px; transition: border-color 0.2s, box-shadow 0.2s;
}
.p-ann-card.is-unread { border-color: var(--black); cursor: pointer; }
.p-ann-card.is-unread:hover { box-shadow: 0 10px 26px rgba(10,10,10,0.08); }
.p-ann-new {
  position: absolute; top: 14px; right: 16px;
  background: #d23; color: #fff; font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 3px 7px;
}
.p-ann-card-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; padding-right: 40px; }
.p-ann-card-title { font-weight: 500; font-size: 15px; color: var(--black); }
.p-ann-card-time { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); margin-left: auto; }
.p-ann-card-body { font-size: 14px; font-weight: 300; line-height: 1.6; color: var(--muted); white-space: pre-wrap; }
@media (max-width: 600px) { .p-ann { padding: 8px 24px 0; } }

/* ============================================================
   MESSAGE RACHEL — slide-over panel
   ============================================================ */
.msg-overlay {
  position: fixed; inset: 0; z-index: 95; background: rgba(10,10,10,0.45);
  opacity: 0; transition: opacity 0.25s var(--ease-out);
  display: flex; justify-content: flex-end;
}
.msg-overlay.is-open { opacity: 1; }
.msg-panel {
  width: 420px; max-width: 100%; height: 100%; background: var(--white);
  display: flex; flex-direction: column;
  transform: translateX(40px); transition: transform 0.28s var(--ease-out);
  box-shadow: -20px 0 50px rgba(10,10,10,0.18);
}
.msg-overlay.is-open .msg-panel { transform: translateX(0); }
.msg-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 24px; border-bottom: 1px solid var(--border); flex: 0 0 auto;
}
.msg-panel-tag { font-size: 10px; letter-spacing: 0.25em; color: var(--muted); display: block; margin-bottom: 4px; }
.msg-panel-title { font-family: var(--f-display); font-size: 24px; letter-spacing: 0.02em; }
.msg-panel-close { background: none; border: 0; font-size: 28px; line-height: 1; color: var(--muted); cursor: pointer; }
.msg-panel-close:hover { color: var(--black); }
.msg-thread { flex: 1; min-height: 0; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 14px; background: var(--off-2); }
.msg-empty { margin: auto; text-align: center; color: var(--muted); font-size: 13px; font-weight: 300; max-width: 240px; line-height: 1.6; }
.msg-bubble { max-width: 80%; display: flex; flex-direction: column; gap: 4px; }
.msg-bubble.is-me { align-self: flex-end; align-items: flex-end; }
.msg-bubble.is-rachel { align-self: flex-start; align-items: flex-start; }
.msg-bubble-body {
  padding: 11px 15px; font-size: 14px; line-height: 1.5; font-weight: 300; white-space: pre-wrap;
  border: 1px solid var(--border);
}
.msg-bubble.is-me .msg-bubble-body { background: var(--black); color: var(--white); border-color: var(--black); }
.msg-bubble.is-rachel .msg-bubble-body { background: var(--white); color: var(--black); }
.msg-bubble-time { font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.msg-compose { display: flex; gap: 10px; padding: 16px; border-top: 1px solid var(--border); flex: 0 0 auto; align-items: flex-end; }
.msg-input {
  flex: 1; resize: none; font-family: var(--f-body); font-size: 14px; font-weight: 300;
  padding: 12px 14px; border: 1px solid var(--border); background: var(--white); color: var(--black);
  line-height: 1.4; max-height: 120px;
}
.msg-input:focus { outline: none; border-color: var(--black); }
.msg-send {
  flex: 0 0 auto; width: 44px; height: 44px; border: 0; cursor: pointer;
  background: var(--black); display: flex; align-items: center; justify-content: center;
  transition: opacity 0.2s;
}
.msg-send:hover { opacity: 0.85; }
.msg-send-ico {
  width: 18px; height: 18px; background: var(--white);
  -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='black'%3E%3Cpath%20d='M3.4%2020.4l17.45-7.48a1%201%200%200%200%200-1.84L3.4%203.6a.993.993%200%200%200-1.39.91L2%209.12c0%20.5.37.93.87.99L17%2012%202.87%2013.88c-.5.07-.87.5-.87%201l.01%204.61c0%20.71.73%201.2%201.39.91z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='black'%3E%3Cpath%20d='M3.4%2020.4l17.45-7.48a1%201%200%200%200%200-1.84L3.4%203.6a.993.993%200%200%200-1.39.91L2%209.12c0%20.5.37.93.87.99L17%2012%202.87%2013.88c-.5.07-.87.5-.87%201l.01%204.61c0%20.71.73%201.2%201.39.91z'/%3E%3C/svg%3E") center / contain no-repeat;
}
@media (max-width: 480px) { .msg-panel { width: 100%; } }

/* RESOURCE CARDS */
.res-card {
  background: var(--white); border: 1px solid var(--border);
  display: flex; flex-direction: column;
  cursor: pointer; transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), border-color 0.3s;
  overflow: hidden; position: relative;
}
.res-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(10,10,10,0.10); border-color: var(--black); }

/* Featured cards span 2 cols on wider screens */
@media (min-width: 720px) {
  .res-card.is-featured { grid-column: span 2; }
}

.res-thumb {
  position: relative; aspect-ratio: 4/3;
  background: var(--off);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; border-bottom: 1px solid var(--border);
}
.res-thumb::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 30% 20%, rgba(10,10,10,0.06), transparent 50%),
    repeating-linear-gradient(180deg, var(--off) 0 26px, var(--off-2) 26px 27px);
  opacity: 0.7;
}
.res-card.is-featured .res-thumb { aspect-ratio: 16/9; }

.res-thumb-icon {
  position: relative; z-index: 1;
  width: 110px; height: 140px;
  background: var(--white);
  border: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 22px 16px; gap: 10px;
  font-family: var(--f-body);
  box-shadow: 0 10px 28px rgba(10,10,10,0.10);
  transition: transform 0.4s var(--ease-out);
}
.res-card:hover .res-thumb-icon { transform: rotate(-3deg) translateY(-4px); }

/* Folded corner */
.res-thumb-icon::before {
  content: ""; position: absolute; top: 0; right: 0;
  border-style: solid;
  border-width: 0 16px 16px 0;
  border-color: transparent var(--off) transparent transparent;
  filter: drop-shadow(-1px 1px 0 var(--border));
}

.res-thumb-icon .lines { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.res-thumb-icon .line { height: 2px; background: var(--border); border-radius: 1px; }
.res-thumb-icon .line:nth-child(1) { width: 80%; }
.res-thumb-icon .line:nth-child(2) { width: 95%; }
.res-thumb-icon .line:nth-child(3) { width: 75%; }
.res-thumb-icon .line:nth-child(4) { width: 88%; }
.res-thumb-icon .line:nth-child(5) { width: 60%; }

.res-thumb-type {
  font-family: var(--f-display); font-size: 18px; letter-spacing: 0.06em;
  color: var(--black); align-self: flex-start;
}
.res-card.is-featured .res-thumb-icon { width: 130px; height: 170px; }

/* File-type colour accents */
.res-card[data-type="pdf"]   .res-thumb-type { color: #b73a3a; }
.res-card[data-type="doc"]   .res-thumb-type { color: #2b6cb0; }
.res-card[data-type="image"] .res-thumb-type { color: var(--warm-deep, #8C6F3F); color: var(--signal); }
.res-card[data-type="link"]  .res-thumb-type { color: var(--black); }
.res-card[data-type="audio"] .res-thumb-type { color: #6b46c1; }
.res-card[data-type="video"] .res-thumb-type { color: var(--black); }

/* Featured ribbon */
.res-ribbon {
  position: absolute; top: 14px; left: 14px;
  background: var(--black); color: var(--white);
  font-size: 9px; letter-spacing: 0.28em; text-transform: uppercase;
  padding: 4px 10px;
  z-index: 2;
}

.res-body {
  padding: 22px 22px 18px;
  display: flex; flex-direction: column; gap: 8px;
  flex: 1;
}
.res-meta-line {
  display: flex; align-items: center; gap: 10px;
  font-size: 9px; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.res-meta-line .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }
.res-title {
  font-family: var(--f-display); font-size: 22px; letter-spacing: 0.02em;
  line-height: 1.05; color: var(--black);
}
.res-card.is-featured .res-title { font-size: 28px; }
.res-desc {
  font-size: 13px; color: var(--muted); line-height: 1.65;
  font-weight: 300;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.res-foot {
  margin-top: auto;
  padding: 0 22px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}

/* Animated download button */
.res-dl {
  background: var(--black); color: var(--white); border: 0;
  padding: 12px 18px;
  font-family: var(--f-body); font-size: 10px;
  letter-spacing: 0.24em; text-transform: uppercase;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 10px;
  position: relative; overflow: hidden;
  transition: background 0.2s, color 0.2s, padding 0.3s;
  min-width: 130px;
  justify-content: center;
}
.res-dl:hover { background: var(--black-2); }
.res-dl .dl-arrow {
  width: 12px; height: 12px;
  position: relative;
  transition: transform 0.3s var(--ease-out);
}
.res-dl .dl-arrow::before {
  content: ""; position: absolute; left: 50%; top: 0;
  width: 1px; height: 8px; background: currentColor;
  transform: translateX(-50%);
}
.res-dl .dl-arrow::after {
  content: ""; position: absolute; left: 50%; top: 5px;
  width: 7px; height: 7px;
  border-right: 1px solid currentColor; border-bottom: 1px solid currentColor;
  transform: translateX(-50%) rotate(45deg);
}
.res-dl:hover:not(.is-loading):not(.is-saved) .dl-arrow { transform: translateY(2px); }

/* Loading state — bar fills */
.res-dl.is-loading { color: rgba(255,255,255,0.7); pointer-events: none; }
.res-dl.is-loading .dl-arrow { display: none; }
.res-dl.is-loading::before {
  content: ""; position: absolute; left: 0; bottom: 0;
  height: 2px; background: var(--signal); width: 0;
  animation: dlFill 1.1s var(--ease-out) forwards;
}
@keyframes dlFill { to { width: 100%; } }

/* Saved state */
.res-dl.is-saved {
  background: var(--white); color: var(--black);
  border: 1px solid var(--black);
}
.res-dl.is-saved .dl-arrow { display: none; }
.res-dl.is-saved .dl-check {
  display: inline-block; width: 12px; height: 12px;
  position: relative;
}
.res-dl.is-saved .dl-check::after {
  content: ""; position: absolute; left: 1px; top: 4px;
  width: 4px; height: 7px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}
.res-dl .dl-check { display: none; }

/* Library empty state */
.lib-empty {
  background: var(--off); padding: 80px 48px; text-align: center;
  border: 1px dashed var(--border);
}
.lib-empty .tag-line { display: block; margin-bottom: 14px; color: var(--muted); font-size: 9px; letter-spacing: 0.3em; text-transform: uppercase; }
.lib-empty .empty-title { font-family: var(--f-display); font-size: 36px; letter-spacing: 0.02em; margin-bottom: 8px; }
.lib-empty .empty-copy { font-size: 14px; color: var(--muted); font-weight: 300; max-width: 460px; margin: 0 auto; }

/* Mobile spacing for library */
@media (max-width: 768px) {
  .lib-section { padding: 36px 22px; }
  .lib-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .lib-walkthroughs { grid-template-columns: 1fr; }
  .res-card.is-featured { grid-column: auto; }
  .res-title { font-size: 18px; }
  .res-card.is-featured .res-title { font-size: 22px; }
}

/* ==========================  MOBILE  ================================= */
@media (max-width: 768px) {
  .p-nav     { padding: 0 22px; }
  .p-welcome { padding: 48px 22px 56px; }
  .p-grid    { grid-template-columns: 1fr; }
  .p-card    { padding: 36px 28px; min-height: 260px; }
  .p-section { padding: 36px 22px; }
  .p-footer  { padding: 18px 22px; flex-direction: column; gap: 8px; text-align: center; }
  .p-pillar-head { grid-template-columns: 1fr; gap: 14px; align-items: start; }
  .p-pillar-head-num { font-size: 80px; }
}

/* =====================================================================
   Quiz — instant-feedback multiple choice (authored via [quiz] blocks)
   ===================================================================== */
.quiz {
  margin: 32px 0;
  padding: 26px 26px 28px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--off-2);
}
.quiz-head {
  font-family: var(--f-display);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}
.quiz-q { margin-top: 22px; }
.quiz-q:first-of-type { margin-top: 0; }
.quiz-q-text {
  font-size: 17px;
  font-weight: 500;
  color: var(--black);
  line-height: 1.4;
  margin-bottom: 14px;
}
.quiz-opts { display: flex; flex-direction: column; gap: 10px; }
.quiz-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--white);
  color: var(--black);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.35;
  cursor: pointer;
  transition: border-color 0.18s var(--ease-out), background 0.18s var(--ease-out);
}
.quiz-opt:hover { border-color: var(--black); }
.quiz-opt-mark {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  border: 1.5px solid var(--faint);
  border-radius: 50%;
  position: relative;
  transition: border-color 0.18s var(--ease-out);
}
.quiz-opt-text { flex: 1; }

/* Once answered, lock the whole question */
.quiz-q.is-answered .quiz-opt { cursor: default; }
.quiz-q.is-answered .quiz-opt:hover:not(.is-correct):not(.is-wrong) { border-color: var(--border); }

/* Correct */
.quiz-opt.is-correct {
  border-color: #1a7f5a;
  background: #edf7f1;
}
.quiz-opt.is-correct .quiz-opt-mark {
  border-color: #1a7f5a;
  background: #1a7f5a;
}
.quiz-opt.is-correct .quiz-opt-mark::after {
  content: "";
  position: absolute;
  left: 6px; top: 3px;
  width: 5px; height: 9px;
  border: solid var(--white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Wrong (only the one they picked) */
.quiz-opt.is-wrong {
  border-color: #c0392b;
  background: #fbedeb;
}
.quiz-opt.is-wrong .quiz-opt-mark {
  border-color: #c0392b;
  background: #c0392b;
}
.quiz-opt.is-wrong .quiz-opt-mark::after {
  content: "";
  position: absolute;
  left: 9px; top: 4px;
  width: 2px; height: 12px;
  background: var(--white);
  box-shadow: 0 0 0 0 transparent;
  transform: rotate(45deg);
}
.quiz-opt.is-wrong .quiz-opt-mark::before {
  content: "";
  position: absolute;
  left: 9px; top: 4px;
  width: 2px; height: 12px;
  background: var(--white);
  transform: rotate(-45deg);
}

.quiz-explain {
  margin-top: 12px;
  padding: 12px 16px;
  border-left: 2px solid var(--black);
  background: var(--off);
  font-size: 14px;
  line-height: 1.5;
  color: var(--black);
}

/* Quiz score summary */
.quiz-score {
  margin-top: 22px;
  padding: 20px 22px;
  border: 1px solid var(--black);
  border-radius: 4px;
  background: var(--white);
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.quiz-score-num {
  font-family: var(--f-display);
  font-size: 34px;
  line-height: 1;
  color: var(--black);
  letter-spacing: 0.02em;
}
.quiz-score-msg {
  flex: 1;
  min-width: 180px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.4;
}
.quiz-retry {
  font-family: var(--f-body);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--black);
  background: var(--off);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 9px 16px;
  cursor: pointer;
  transition: border-color 0.18s var(--ease-out), background 0.18s var(--ease-out);
}
.quiz-retry:hover { border-color: var(--black); background: var(--off-2); }
