.project-back { color: var(--ink); text-underline-offset: 4px; }
.project-nav-actions { display:flex; align-items:center; gap:14px; font-size:13px; }
.project-nav-actions a { color:var(--ink); text-underline-offset:4px; }
.project-loading { display: grid; min-height: 70svh; place-content: center; text-align: center; color: var(--muted); }
.project-loading[hidden], .project-layout[hidden] { display: none; }
.project-layout { width: min(1240px, calc(100% - 48px)); margin: 48px auto 100px; display: grid; grid-template-columns: 260px minmax(0, 760px); gap: clamp(48px, 8vw, 120px); justify-content: center; align-items: start; }
.project-sidebar { position: sticky; top: 30px; }
.project-progress { margin: 16px 0 28px; display: flex; gap: 12px; align-items: center; font-size: 13px; color: var(--muted); }
#progress-label { min-width: 34px; white-space: nowrap; }
.project-progress > div { width: 100%; height: 5px; overflow: hidden; border-radius: 9px; background: var(--line); }
.project-progress i { display: block; width: 0; height: 100%; background: var(--ink); transition: width .25s ease; }
#project-nav { display: grid; gap: 3px; }
#project-nav a { padding: 9px 10px; overflow: hidden; border-radius: 9px; color: var(--muted); font-size: 13px; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
#project-nav a:hover, #project-nav a:focus-visible { color: var(--ink); background: rgba(23,23,25,.05); outline: none; }
.project-hero { padding: 20px 0 72px; border-bottom: 1px solid var(--line); }
.project-hero h1 { margin: 20px 0 14px; font-family: "Instrument Serif", Georgia, serif; font-size: clamp(72px, 12vw, 130px); font-weight: 400; line-height: .82; }
.project-hero > p:not(.portal-kicker) { max-width: 620px; color: var(--muted); font-size: 20px; line-height: 1.5; }
.project-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.project-tags span { padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; }
.project-references { padding: 58px 0; border-bottom: 1px solid var(--line); }
.project-references[hidden] { display: none; }
.project-references__head { margin-bottom: 28px; }
.project-references__head h2 { margin: 10px 0 0; font-size: clamp(30px, 4vw, 46px); }
.project-references__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.project-reference { margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--card); }
.project-reference img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: top; background: #efede8; }
.project-reference figcaption { padding: 12px 14px; color: var(--muted); font-size: 12px; }
.project-reference.is-unavailable { min-height:180px; display:flex; flex-direction:column; justify-content:flex-end; background:#eceae5; }
.asset-unavailable { margin:0; padding:22px 18px 8px; color:var(--muted); font-size:12px; line-height:1.55; }
.course-section { padding: 58px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 24px; }
.course-section__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.course-section__index { display: block; margin-bottom: 10px; color: var(--muted); font-size: 11px; letter-spacing: .12em; }
.course-section h2 { margin: 0; font-size: clamp(28px, 4vw, 44px); line-height: 1.08; }
.course-section__actions { display: flex; gap: 8px; flex: none; }
.course-copy, .course-complete { min-height: 38px; padding: 0 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); background: transparent; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.course-copy:hover, .course-complete:hover { border-color: var(--ink); }
.course-complete[aria-pressed="true"] { color: white; background: var(--ink); }
.course-body { color: #303033; font-size: 16px; line-height: 1.7; }
.course-body h3 { margin: 34px 0 12px; color: var(--ink); font-size: 20px; }
.course-body p { margin: 0 0 16px; }
.course-body ul { margin: 0 0 22px; padding-left: 22px; }
.course-body li { margin: 7px 0; }
.course-section[data-kind="prompt"] .course-body { padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); }
.course-error { max-width: 580px; margin: 18vh auto; padding: 0 24px; text-align: center; }
.course-error h1 { font-family: "Instrument Serif", Georgia, serif; font-size: 64px; font-weight: 400; }
@media (max-width: 900px) {
  .project-layout { grid-template-columns: 1fr; }
  .project-sidebar { position: static; }
  #project-nav { display: flex; overflow-x: auto; padding-bottom: 8px; }
  #project-nav a { flex: none; max-width: 220px; }
}
@media (max-width: 600px) {
  .project-layout { width: min(100% - 32px, 760px); margin-top: 24px; }
  .project-hero { padding-bottom: 48px; }
  .course-section { padding: 44px 0; }
  .course-section__head { flex-direction: column; }
  .course-section__actions { width: 100%; }
  .course-copy, .course-complete { flex: 1; }
  .project-references__grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .project-progress i, .library-card[href] { transition: none; } }

/* ============================================================
   Guided prompt workspace — mobile first
   ============================================================ */

.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.project-layout { width: min(100% - 32px, 820px); margin: 20px auto 90px; grid-template-columns: 1fr; gap: 28px; }
.project-sidebar { position: sticky; z-index: 12; top: 0; margin: 0 -16px; padding: 12px 16px 10px; background: rgba(246,243,238,.94); border-bottom: 1px solid var(--line); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.project-sidebar > .portal-kicker { display: none; }
.project-progress { margin: 0 0 9px; }
#project-nav { display: flex; gap: 4px; overflow-x: auto; padding: 0 0 3px; scrollbar-width: none; }
#project-nav::-webkit-scrollbar { display: none; }
#project-nav a { flex: none; max-width: 210px; min-height: 38px; padding: 0 11px; display: flex; align-items: center; }
#project-nav a.is-active { background: #171719; color: #fff; }
#project-nav a.is-complete::after { content:"✓"; margin-left:8px; color:#3b8a5a; font-weight:900; }
#project-nav a.is-active.is-complete::after { color:#8ee0aa; }
.project-content { min-width: 0; }
.project-hero { padding: 34px 0 54px; }
.project-hero h1 { margin-top: 18px; font-size: clamp(68px, 22vw, 105px); }
.project-hero > p:not(.portal-kicker) { font-size: 17px; }
.project-tags span.is-tool { border-color: #9da9c5; background: #e7ecf7; color: #405680; }
.workspace-hero-actions { margin-top: 28px; display: grid; gap: 10px; }
.workspace-primary { min-height: 52px; padding: 0 17px; display: flex; align-items: center; justify-content: space-between; border-radius: 13px; background: #171719; color: #fff; font-size: 14px; font-weight: 800; text-decoration: none; }
.workspace-hero-actions p { margin: 0; color: var(--muted); font-size: 12px; }
.workspace-hero-actions p a { color: var(--ink); text-underline-offset: 3px; }

.project-references { padding: 48px 0; }
.project-references__grid { grid-template-columns: 1fr; }
.course-section { padding: 52px 0; scroll-margin-top: 86px; }
.course-section__head { margin-bottom: 20px; flex-direction: column; gap: 18px; }
.course-section__head > div:first-child { width: 100%; }
.course-section h2 { max-width: 650px; font-size: clamp(30px, 8vw, 46px); letter-spacing: -.035em; }
.course-section__summary { margin-top: 13px; display: flex; flex-wrap: wrap; gap: 7px; }
.course-section__summary span { padding: 6px 8px; border-radius: 7px; background: #e9edf2; color: #667184; font-size: 10px; font-weight: 750; }
.course-section__actions { width: 100%; }
.course-copy, .course-complete { min-height: 44px; flex: 1; border-radius: 11px; }
.course-copy { border-color: #171719; background: #171719; color: #fff; }
.course-complete[aria-pressed="true"] { background: #dff0e5; border-color: #c6e4d0; color: #216c42; }
.course-objective,
.course-checkpoint { padding: 16px; display: grid; grid-template-columns: 82px 1fr; gap: 12px; border-radius: 13px; }
.course-objective { margin-bottom: 12px; background: #e8edf6; }
.course-checkpoint { margin-top: 12px; background: #e2f1e8; }
.course-objective > span,
.course-checkpoint > span { color: #66758d; font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.course-checkpoint > span { color: #4f8062; }
.course-objective p,
.course-checkpoint p { margin: 0; color: #354156; font-size: 13px; line-height: 1.45; }
.course-checkpoint p { color: #315e43; }
.prompt-tool-selector { margin: 0 0 10px; padding: 12px; display: flex; align-items: center; gap: 6px; overflow-x: auto; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,253,249,.72); scrollbar-width: none; }
.prompt-tool-selector::-webkit-scrollbar { display:none; }
.prompt-tool-selector > span { margin-right: 4px; flex: none; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.prompt-tool-selector button { min-height: 36px; padding: 0 10px; flex: none; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); font: 700 10px/1 "HK Grotesk",Arial,sans-serif; cursor: pointer; }
.prompt-tool-selector button[aria-pressed="true"] { border-color: #171719; background: #171719; color: #fff; }
.course-section[data-kind="prompt"] .course-body { padding: 20px; border-color: #171920; border-radius: 14px; background: #171920; color: #e7eaf0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.7; box-shadow: 0 24px 50px -38px rgba(15,17,24,.7); }
.course-section[data-kind="prompt"] .course-body p:last-child { margin-bottom:0; }
.course-help { margin-top: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,253,249,.68); }
.course-help summary { min-height: 48px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; color: #525e70; font-size: 12px; font-weight: 750; cursor: pointer; list-style: none; }
.course-help summary::-webkit-details-marker { display:none; }
.course-help summary::after { content:"+"; font-size:18px; font-weight:400; }
.course-help[open] summary::after { content:"−"; }
.course-help p { margin: 0; padding: 0 14px 16px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.course-step-nav { margin-top: 26px; padding-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); }
.course-step-nav a { min-height: 44px; display: flex; align-items: center; color: #43567c; font-size: 12px; font-weight: 800; text-decoration: none; }
.course-copy:focus-visible,
.course-complete:focus-visible,
.prompt-tool-selector button:focus-visible,
.course-help summary:focus-visible,
.course-step-nav a:focus-visible,
.workspace-primary:focus-visible { outline: 3px solid rgba(70,101,182,.32); outline-offset: 3px; }

@media (min-width: 760px) {
  .project-layout { width: min(1240px, calc(100% - 64px)); margin-top: 48px; grid-template-columns: 230px minmax(0,760px); gap: clamp(52px,7vw,100px); }
  .project-sidebar { position: sticky; top: 26px; margin:0; padding:0; border:0; background:transparent; -webkit-backdrop-filter:none; backdrop-filter:none; }
  .project-sidebar > .portal-kicker { display:block; }
  .project-progress { margin:16px 0 28px; }
  #project-nav { display:grid; overflow:visible; }
  #project-nav a { max-width:100%; }
  .project-hero { padding-top:20px; }
  .workspace-hero-actions { grid-template-columns: auto 1fr; align-items:center; }
  .workspace-primary { width:max-content; min-width:210px; }
  .project-references__grid { grid-template-columns:repeat(2,1fr); }
  .course-section { scroll-margin-top:24px; }
  .course-section__head { flex-direction:row; }
  .course-section__actions { width:auto; }
  .course-copy, .course-complete { flex:none; }
  .course-objective, .course-checkpoint { grid-template-columns:110px 1fr; padding:18px; }
}

@media (prefers-reduced-motion: reduce) {
  .project-progress i { transition:none; }
}

.workspace-footer { margin-top: 28px; padding: 24px 0 calc(20px + env(safe-area-inset-bottom)); display:grid; gap:14px; border-top:1px solid var(--line); }
.workspace-footer span { color:var(--ink); font-size:13px; font-weight:800; }
.workspace-footer p { max-width:490px; margin:5px 0 0; color:var(--muted); font-size:12px; line-height:1.5; }
.workspace-footer a { min-height:44px; display:flex; align-items:center; color:var(--ink); font-size:12px; font-weight:750; text-underline-offset:4px; }
@media (min-width:760px) { .workspace-footer { grid-template-columns:1fr auto auto; align-items:center; gap:24px; } }
