@import url('/pap-project-intent.css');
@import url('/pap-tiles.css');
/* One persistent project frame. Phase colours and recorded status stay distinct. */
.shell { padding-top: 16px; }
#workspaceHeader { min-height: 64px; margin-bottom: 20px; padding-bottom: 12px; align-items: center; }
#workspaceHeader .brand.compact { flex: 1; min-width: 0; }
#workspaceHeader #workspaceHeading { min-width: 0; }
#workspaceHeader h1 { font-size: 1.05rem; overflow-wrap: break-word; }
#workspaceHeader .eyebrow { font-size: .66rem; font-weight: 500; }
.account-menu { position: relative; flex: 0 0 auto; }
.account-menu > summary { display: flex; gap: 8px; align-items: center; min-height: 44px; padding: 8px; cursor: pointer; color: var(--muted); font-size: .85rem; border-radius: 4px; }
.account-menu > summary:hover { background: var(--soft); }
.account-menu .account { position: absolute; z-index: 60; right: 0; top: calc(100% + 6px); width: 250px; max-width: calc(100vw - 32px); padding: 12px; background: white; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 24px #12142e18; display: grid; gap: 4px; }
.account-menu .account > * { min-height: 44px; padding: 10px; }
.account-menu #accountName { border-top: 1px solid var(--line); margin-top: 4px; }
.pap-return-links { margin-bottom: 12px; gap: 18px; }
.pap-return-links a { min-height: 36px; font-size: .84rem; }
.phase-workspace > .section-head { margin-bottom: 8px; gap: 10px; align-items: center; }
.phase-workspace > .section-head > div:first-child { flex: 1; min-width: 0; }
.phase-workspace .project-title { font-size: 1.5rem; }
.phase-workspace.phase-entry #papTitle { color: var(--accent); }
.phase-workspace #viewEyebrow { display: none; }
.phase-workspace #editPapButton { width: 44px; height: 44px; padding: 10px; }
.phase-workspace .pap-stored-phase { margin: 0 0 12px; font-size: .78rem; }
.phase-workspace .pap-phases-heading { font-size: .85rem; color: var(--muted); margin: 20px 0 12px; }
.phase-workspace .pap-phases { margin: 0 0 20px; }
#papPhases[hidden], #papPhaseToggle[hidden] { display: none; }
.phase-workspace .pap-phase-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 44px; margin: 0 0 12px; padding: 10px 12px; text-align: left; font-size: .875rem; }
.pap-phase-toggle > span { min-width: 0; overflow-wrap: anywhere; }
.pap-phase-toggle > svg { width: 18px; height: 18px; flex-shrink: 0; }
.pap-phase-toggle[aria-expanded=true] > svg { transform: rotate(180deg); }
.pap-phase-toggle:focus-visible { outline: 3px solid #005b96; outline-offset: 3px; }
.phase-workspace .pap-phases a { min-width: 0; position: relative; gap: 8px; }
.phase-workspace .pap-phases a svg { display: block; }
.phase-workspace .pap-phases.compact { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.phase-workspace .pap-phases.compact a { display: flex; flex-direction: row; align-items: center; flex-wrap: wrap; justify-content: center; align-content: center; padding: 10px 20px 10px 10px; min-height: 64px; font-size: .875rem; border-width: 2px; }
.phase-workspace .pap-phases.compact a span { min-width: 0; text-align: center; }
.phase-workspace .pap-phases.compact a[aria-current=page] { box-shadow: inset 0 -4px var(--phase-color); }
.phase-recorded { display: flex; justify-content: center; align-items: center; gap: 5px; width: 100%; font-size: .68rem; font-weight: 500; color: var(--muted); }
.phase-recorded svg { width: 12px; height: 12px; flex-basis: 12px; }
.phase-recorded.done { color: #236844; }
.phase-workspace .pap-phase-content { border: 0; padding: 0; margin: 0 0 18px; }
.phase-workspace #papPhaseTitle { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.phase-workspace .pap-phase-actions { display: flex; flex-wrap: wrap; gap: 4px 16px; border-bottom: 1px solid var(--line); padding: 0; }
.phase-workspace .pap-phase-actions a { display: inline-flex; gap: 7px; align-items: center; min-height: 44px; padding: 8px 2px; background: none; border: 0; border-radius: 0; font-size: .875rem; font-weight: 500; color: var(--muted); }
.phase-workspace .pap-phase-actions a[aria-current=page] { color: var(--accent); border-bottom: 3px solid var(--accent); font-weight: 700; }
.phase-workspace .pap-phase-actions a:hover { background: var(--field); }
.phase-workspace .pap-navigation { position: relative; margin: 0; border: 0; font-size: .875rem; flex: 0 0 auto; }
.phase-workspace .pap-navigation > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 8px; width: fit-content; min-height: 44px; color: var(--muted); }
.phase-workspace .pap-navigation #papCurrentView { display: flex; align-items: center; gap: 8px; }
.phase-workspace .pap-navigation .pap-tabs { position: absolute; z-index: 55; top: calc(100% + 6px); right: 0; display: grid; gap: 4px; width: 250px; max-width: calc(100vw - 32px); padding: 10px; margin: 0; border: 1px solid var(--line); border-radius: 6px; background: white; box-shadow: 0 8px 24px #12142e18; }
.phase-workspace .pap-navigation .pap-tabs a { min-height: 44px; border: 0; padding: 10px; }
.phase-workspace .pap-navigation .pap-tabs { max-height: 70vh; overflow-y: auto; }
.phase-workspace .pap-navigation .document-tabs { padding: 8px 0; border-top: 1px solid var(--line); }
.phase-workspace .pap-navigation .document-tabs { margin: 0; }
.pap-hub-brief { display: flex; gap: 20px; align-items: center; justify-content: space-between; padding: 12px 0; }
.pap-hub-brief p { margin: 0; max-width: 680px; line-height: 1.6; }
.pap-brief-view { display: grid; gap: 24px; max-width: 900px; margin: 24px 0; }
.pap-brief-view p { white-space: pre-line; line-height: 1.65; }
.pap-brief-view button { justify-self: start; }
.phase-workspace .wf-progress { display: none; }
.phase-workspace .wf-heading { margin: 0 0 8px; padding: 0; }
.phase-workspace .wf-heading .wf-kicker { display: none; }
.phase-workspace .wf-kicker { font-size: .72rem; }
.phase-workspace .wf-heading h3 { font-size: 1rem; }
.phase-workspace .wf-foundation { margin: 0 0 12px; }
.phase-workspace .wf-map-head { margin: 0; }
.wf-map-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0 0 8px; }
.phase-workspace .wf-breadcrumb { padding: 0; margin: 0; }
.phase-workspace .wf-workspace .wf-viewport { max-height: none; }
.wf-map-key { position: relative; }
.wf-map-key > summary { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; list-style: none; }
.wf-map-key .wf-legend { position: absolute; right: 0; top: 100%; z-index: 3; background: white; border: 1px solid var(--line); padding: 14px; width: 200px; display: grid; gap: 12px; }
.wf-map-key small { color: var(--muted); }
.phase-workspace .wf-legend { margin-bottom: 10px; }
#workflowView[data-work-phase=anstoss] .wf-breadcrumb,
#workflowView[data-work-phase=anstoss] .wf-map-toolbar,
#workflowView[data-work-phase=anstoss] .wf-map-head,
#workflowView[data-work-phase=anstoss] .wf-legend,
#workflowView[data-work-phase=anstoss] .wf-workspace,
#workflowView[data-work-phase=anstoss] .wf-analysis,
#workflowView[data-work-phase=anstoss] .wf-edit-tools { display: none; }
#workflowView[data-work-phase=anstoss] .wf-foundation > summary { display: none; }
#workflowView[data-work-phase=anstoss] .wf-impulse p { line-height: 1.65; max-width: 900px; }
#workflowView[data-work-phase=anstoss] .wf-impulse { margin-bottom: 18px; }
#workflowView[data-work-phase=anstoss] .wf-inventory { margin-top: 20px; }
.cn-browser-link { display: flex; align-items: center; gap: 8px; min-height: 44px; }
#factoryView { padding-top: 0; }
#factoryView #factoryCourseBar { padding: 0; border: 0; border-radius: 0; }
#factoryView .factory-moodle-list { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
#factoryView .factory-moodle-list > li { min-width: 0; }
#factoryView .factory-moodle-list .factory-course-link { min-height: 80px; padding: 16px; font-size: 16px; }
#factoryView .factory-moodle-list .factory-course-link > span { white-space: normal; overflow-wrap: anywhere; hyphens: auto; }
#factoryView #factoryMoodleHeading { margin-bottom: 14px; font-size: 18px; }
#factoryView[data-mode=courses] #factoryMessage[data-kind=availability] { display: none; }
#factoryView[data-mode=production] #factoryCourseBar { margin: 16px 0; }
#factoryView[data-mode=production] #factoryComposer:not([hidden]) { display: block; }
#factoryView[data-mode=production] #factoryCourseBar > :not(#factoryCourseSources) { display: none; }
#factoryCourseSources, #factoryTechnical { padding: 12px 0; border-top: 1px solid var(--line); }
#factoryCourseSources > summary, #factoryTechnical > summary { cursor: pointer; display: flex; gap: 8px; align-items: center; min-height: 44px; font-size: 14px; color: var(--muted); }
#factoryCourseSources > summary::after, #factoryTechnical > summary::after { content: "+"; margin-left: auto; }
#factoryCourseSources[open] > summary::after, #factoryTechnical[open] > summary::after { content: "−"; }
#factoryCourseDetails { padding-top: 14px; }
@media (max-width: 900px) {
  #factoryView .factory-moodle-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #factoryView .factory-moodle-list .factory-course-link { padding: 12px; font-size: 14px; }
}
@media (max-width: 380px) { #factoryView .factory-moodle-list { grid-template-columns: minmax(0,1fr); } }
@media (max-width: 900px) {
  .phase-workspace .pap-phases.compact { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .phase-workspace .pap-phases.compact a { min-height: 64px; }
}
@media (max-width: 600px) {
  .shell { padding: 12px 16px 32px; }
  #workspaceHeader { flex-direction: row; gap: 8px; margin-bottom: 12px; }
  #workspaceHeader .brand.compact { gap: 10px; }
  #workspaceHeader .workspace-heading:has(#workspaceBrand:not([hidden])) h1 { display: none; }
  #workspaceHeader .workspace-brand { border: 0; margin: 0; padding: 0; }
  #workspaceHeader .account-menu > summary span { display: none; }
  #workspaceHeader .account-menu > summary { width: 44px; justify-content: center; }
  #workspaceHeader #workspaceEyebrow { display: none; }
  .phase-workspace .project-title { font-size: 1.2rem; }
  .phase-workspace .pap-phases.compact { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .phase-workspace .pap-phases.compact a { min-height: 58px; font-size: .875rem; }
  .phase-workspace .pap-phases.compact a:last-child { grid-column: 1 / -1; }
  .phase-workspace .pap-navigation #papCurrentView { font-size: 0; gap: 0; }
  .phase-workspace .pap-navigation > summary > svg { display: none; }
  .phase-workspace .pap-navigation > summary { width: 44px; justify-content: center; }
  .phase-workspace .pap-navigation .pap-tabs { right: -54px; }
  .phase-workspace .pap-phase-actions { flex-direction: row; }
  .pap-hub-brief { flex-direction: column; align-items: stretch; }
}

/* Tools of the current view: one quiet layer under the phase bar (R2), chips that wrap on narrow screens. */
.phase-workspace .pap-tool-links { display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 6px 0 0; }
.phase-workspace .pap-tool-link { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--muted); font-size: .82rem; text-decoration: none; }
.phase-workspace .pap-tool-link svg { width: 14px; height: 14px; }
.phase-workspace .pap-tool-link:hover { color: var(--ink); background: var(--field); }
.phase-workspace .pap-tool-link[aria-current=page] { color: var(--accent); border-color: var(--accent); font-weight: 600; }
.phase-workspace .pap-tool-link:focus-visible { outline: 3px solid #005b96; outline-offset: 2px; }

