html[data-pi-shell]:has([data-mental05]) body .workspace[data-pi-shell] .pi-app-layout > #main {
  overflow: hidden auto !important;
}
html[data-pi-shell]:has([data-mental05]) :is(.pi-page-controls, #pi-shell-hero-slot) { display: none !important; }
html[data-pi-shell]:has([data-mental05]) #main #app {
  padding-block: 0 !important;
  inset-block-start: 0;
}
#main #app :is(.section-studio,.ps-workspace,.pt-mental-course,.pt-mental-lesson,.pt-body):has(.mental05-scene) {
  width: 100%;
  max-width: none;
  padding: 0 !important;
  margin: 0 !important;
}
#main #app:has(.mental05-scene) > :is(.ic-entry,.ux-reader-nav),
#main #app:has(.mental05-scene) :is(.pt-mental-course,.pt-mental-lesson) > .pt-screen-head,
#main #app .mental05-scene .psy-site-header {
  display: none !important;
}
#main #app .mental05-scene {
  width: 100%;
  margin: 14px auto 20px;
  display: grid;
  grid-template-columns: minmax(0,.92fr) minmax(0,1.65fr) minmax(0,.9fr);
  gap: 12px;
  color: #f1e9df;
}
#main #app .mental05-block {
  min-width: 0;
  min-height: 0;
  padding: clamp(14px,2vw,24px);
  border: 1px solid #6f5540;
  border-radius: .75rem;
  background: linear-gradient(145deg,#211910b5,#17130fc9 75%);
  box-shadow: inset 0 1px #eabf8d0c;
  scrollbar-width: thin;
}
#main #app .mental05-block :is(h1,h2) {
  font: 400 clamp(20px,2.45vw,37px)/1.1 Georgia,serif !important;
  letter-spacing: -.025em;
  color: #f1e9df;
  margin: 0 0 12px;
}
#main #app .mental05-block h2 { font-size: clamp(19px,2.15vw,30px) !important; }
#main #app .mental05-block .am-text h2 { font-size: clamp(19px,1.65vw,25px) !important; }
#main #app .mental05-block .ps-header,
#main #app .mental05-block .ps-program,
#main #app .mental05-block .ps-form,
#main #app .mental05-block .ps-production {
  padding: 0 !important;
  margin: 0 0 10px !important;
  border: 0 !important;
  background: transparent !important;
}
#main #app .mental05-block .ps-header { display: block; }
#main #app .mental05-block .ps-situation-select { width: 100%; }
#main #app .mental05-next :is(.ps-link, .ps-more a, .mental05-link),
#main #app .mental05-context .mental05-link {
  display: flex;
  width: fit-content;
  min-height: 44px;
  align-items: center;
  color: #efbe92;
  text-decoration: underline;
  text-underline-offset: 3px;
  margin: 0;
}
#main #app .mental05-next .ps-more { display: block; }
#main #app .mental05-next .ps-author-entry { white-space: normal; }
#main #app .mental05-lessons { margin: 10px 0; list-style: none; padding: 0; }
#main #app .mental05-lesson {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: .6rem;
  min-height: 46px;
  padding: .55rem .4rem;
  border-bottom: 1px solid #523b2a;
  text-decoration: none;
  color: #f1e9df;
  font-size: .92rem;
}
#main #app .mental05-lesson small { color: #e3ba91; }
#main #app .mental05-lesson:is(:hover,[aria-current]) { background: linear-gradient(110deg,#4b321f,#3b281b); }
#main #app .mental05-block :is(.am-reading-layout,.am-reader,.am-course,.psy-page,.psy-content) {
  display: block;
  width: 100%;
  max-width: none;
  min-height: 0;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent;
}
#main #app .mental05-study .am-reader { border: 0; }
#main #app .mental05-study .ego-course-intro { padding: 0; }
#main #app .mental05-study .am-text { max-width: none; }
#main #app .mental05-study .ps-actions a { min-height: 44px; }
#main #app .mental05-study :is(input,textarea,select) { max-width: 100%; }
@media (min-width: 921px) and (min-height: 640px) {
  html[data-pi-shell]:has([data-mental05]) #main { container-type: size; }
  #main #app .mental05-scene { height: calc(100cqh - 34px); min-height: 0; }
  #main #app .mental05-block { overflow: auto; }
}
@media (max-width: 920px), (max-height: 639px) {
  #main #app .mental05-scene { grid-template-columns: minmax(0,1fr); margin-top: 6px; }
  #main #app .mental05-block { overflow: visible; }
  #main #app [data-mental05="entry"] .mental05-context .ps-header > p { display: none; }
}
html[data-pi-shell]:has([data-mental05]) #main #app {
  max-width: none !important;
  width: 100% !important;
  margin-inline: 0 !important;
  padding-inline: 0 !important;
}
#main #app .mental05-next .ps-author-entry { justify-self: start; }
#main #app .mental05-context [data-path-read] { color: #dbc6af; margin-top: .6rem; }
#main #app .mental05-study .ego-course-intro { grid-template-columns: minmax(0,1fr) minmax(80px,115px); gap: 12px; }
#main #app .mental05-study :is(.ego-lead,.am-reader > header p,.ego-course-intro > div > p) {
  font-size: 1rem;
  line-height: 1.48;
  margin-block: .4rem;
}
#main #app .mental05-study .ego-lesson-tools { margin-block: .7rem; }
@media (max-width: 600px) {
  #main #app .mental05-study .ego-course-intro { grid-template-columns: 1fr; }
  #main #app .mental05-study .ego-course-intro img { max-width: 86px; }
  #main #app .mental05-context .mental05-link { min-height: 44px; display: inline-flex; margin-right: 12px; }
}
#main #app .mental05-study .am-private-entry > summary { min-height: 44px; display: list-item; padding: .55rem 0; color: #efbe92; cursor: pointer; }
#main #app [data-ss-hash]:has([data-mental05]) > .ss-status:empty { display: none; }


@media (orientation: landscape) and (min-width: 720px) and (max-height: 520px) {
  html[data-pi-shell]:has([data-mental05]) #main { container-type: size; }
  #main #app .mental05-scene {
    grid-template-columns: minmax(0,.95fr) minmax(0,1.55fr) minmax(0,.8fr);
    gap: 8px;
    height: calc(100cqh - 12px);
    margin: 5px auto 7px;
  }
  #main #app .mental05-block { overflow: auto; padding: 10px; border-radius: 9px; }
  #main #app .mental05-block :is(h1,h2) { font-size: 19px !important; margin-bottom: 5px; }
  #main #app [data-mental05="entry"] .mental05-study :is(.ps-program>p,.ps-meta,.ps-draft-label) {
    font-size: .875rem;
    line-height: 1.3;
    margin: 5px 0;
  }
  #main #app .mental05-study .ps-actions { margin-block: 7px 3px; }
  #main #app .mental05-lesson { gap: .25rem; padding-inline: .25rem; }
}
#main #app .mental05-practice-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: .65rem 0;
}
#main #app .mental05-practice-actions > button {
  min-height: 44px;
  margin: 0;
}
#main #app .mental05-study :is([id^="am-"],#ego-finish,#mental05-journal-open) {
  scroll-margin-block-start: 8px !important;
}

/* The stage, palette and controls use the approved 01 «Новичку» settings. */
html[data-pi-shell]:has([data-mental05]) {
  --pi-shell-width: 76.25rem;
  --pi-shell-gutter: clamp(.85rem, 11.5vw, 12rem);
  --pi-shell-lamp-offset: clamp(1rem, 3.4dvh, 2.15rem);
}
html[data-pi-shell]:has([data-mental05]) .workspace[data-pi-shell]::before {
  background:
    linear-gradient(90deg,#100c08b8, #b47c4a35 2.3%, #110e09c0 5.5%, transparent 14% 86%, #110e09c0 94.5%, #b47c4a35 97.7%, #100c08b8),
    radial-gradient(ellipse at 50% 0%,#a56d3a46,transparent 53%),
    linear-gradient(180deg,#17110caf 0%,#110e0bb0 77%,#1a11088a 85%,#0f0b08a5),
    url("./assets/work-scenes/stage.png") center bottom / 100% 100% no-repeat #1b140e;
}
html[data-pi-shell]:has([data-mental05]) .workspace[data-pi-shell]::after {
  height: 3px;
  background: #fff6e8;
  box-shadow: 0 0 5px 1px #ffd4b3, 0 1px 18px 5px #d78e60ad, 0 2px 34px 10px #c4824f63;
}
html[data-pi-shell]:has([data-mental05]) .pi-shell-controls {
  gap: 1.15rem;
  min-height: 52px;
  margin-top: calc(var(--pi-shell-lamp-offset) + 1.7rem);
  padding: 0 .25rem;
  color: #f0bf90;
  font-weight: 500;
  font-size: clamp(.9rem, 1.14vw, 1.125rem);
}
html[data-pi-shell]:has([data-mental05]) body .workspace[data-pi-shell] .pi-app-layout > #main {
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
  scrollbar-color: #79553c transparent;
}
#main #app .mental05-scene {
  --ps-ink: #f1e9df;
  --ps-muted: #d8c2af;
  --ps-line: #6f5540;
  --ps-gold: #f0b780;
  font-family: "PI Work", Manrope, system-ui, sans-serif;
}
#main #app .mental05-block :is(.ps-situation-select,.ps-form input:not([type=checkbox]),.ps-form textarea,.am-journal textarea) {
  background: #17130fc9;
  border: 1px solid #523b2a;
  border-radius: .46rem;
}
html[data-pi-shell]:has([data-mental05]) body .workspace[data-pi-shell] #main #app .mental05-scene .ps-situations button {
  background: #17130fc9 !important;
  border: 1px solid #523b2a !important;
  border-radius: .46rem !important;
  color: #f7f0e7 !important;
  box-shadow: none !important;
}
html[data-pi-shell]:has([data-mental05]) body .workspace[data-pi-shell] #main #app .mental05-scene .ps-situations button[aria-pressed="true"] {
  background: linear-gradient(110deg,#4b321f,#3b281b) !important;
  border-color: #61422d !important;
}
#main #app .mental05-scene .ps-situations button:hover {
  filter: brightness(1.12);
}
#main #app .mental05-study :is(.path-transfer,.am-journal,.am-example,.ego-details,.am-recovery),
#main #app .mental05-study .am-text .ego-practice {
  background-color: #17130fc9;
  border-color: #523b2a;
}
html[data-pi-shell]:has([data-mental05]) body .workspace[data-pi-shell] #main #app .mental05-scene :is(.ss-primary,.am-primary) {
  background: linear-gradient(135deg,#eab58a,#e3a97b 70%,#edb790) !important;
  color: #1c120b !important;
  border: 1px solid #e8b795 !important;
  border-radius: .45rem !important;
  min-height: 3.7rem;
  padding: .55rem clamp(1rem, 2vw, 2rem);
  font: 700 clamp(1rem,1.39vw,1.39rem)/1.18 "PI Work",Manrope,system-ui,sans-serif;
}
html[data-pi-shell]:has([data-mental05]) body .workspace[data-pi-shell] #main #app .mental05-scene :is(.ss-primary,.am-primary):hover { filter: brightness(1.12); }
#main #app .mental05-scene :is(a,button,summary):focus-visible {
  outline: 2px solid #ffd1a0;
  outline-offset: 3px;
}
@media (min-width: 951px) {
  html[data-pi-shell]:has([data-mental05]) { --pi-shell-lamp-offset: clamp(1rem,3.8dvh,2.46rem); }
}
@media (max-width: 950px) {
  html[data-pi-shell]:has([data-mental05]) { --pi-shell-gutter: clamp(.75rem,4vw,2rem); --pi-shell-lamp-offset: .55rem; }
  html[data-pi-shell]:has([data-mental05]) .pi-shell-controls { margin-top: 1rem; min-height: 44px; }
}
@media (max-width: 700px), (max-width: 1050px) and (max-height: 520px) and (orientation: landscape) {
  html[data-pi-shell]:has([data-mental05]) {
    --pi-shell-gutter: max(.72rem, env(safe-area-inset-left), env(safe-area-inset-right));
    --pi-shell-lamp-offset: .44rem;
  }
  html[data-pi-shell]:has([data-mental05]) .pi-shell-controls { margin-top: .6rem; min-height: 2.75rem; }
  #main #app .mental05-scene { gap: .48rem; }
  #main #app .mental05-block { padding: .62rem .74rem; border-radius: .62rem; }
  html[data-pi-shell]:has([data-mental05]) body .workspace[data-pi-shell] #main #app .mental05-scene :is(.ss-primary,.am-primary) { min-height: 2.75rem; padding: .25rem .72rem; font-size: .93rem; }
}
@media (min-width: 360px) and (max-width: 700px) and (min-height: 650px) and (orientation: portrait) {
  #main #app .mental05-scene { gap: .63rem; }
  #main #app .mental05-block { padding: .88rem .9rem; }
  #main #app .mental05-scene [data-ps-start] { width: 100%; min-height: 3rem; }
}

