.study-room {max-width:56rem;margin:0 auto 2rem;color:var(--ink)}
.study-heading {margin-bottom:1.25rem;max-width:47rem}
.study-heading h1 {font:400 clamp(2.55rem,6vw,4.25rem)/1.08 var(--serif);letter-spacing:-.05em;margin:.35rem 0 .6rem}
.study-heading em {color:var(--green)}
.study-heading p,.study-tip,.study-citations small {color:#435d51}
.study-heading p,.study-card p {line-height:1.6}
.study-card {border:1px solid var(--line);border-radius:16px;padding:clamp(1.1rem,3vw,2.05rem);background:var(--paper)}
.study-label,.study-picker legend {display:block;font-weight:650}
.study-tip {margin:.4rem 0 1rem;font-size:.94rem}
.study-room textarea,.study-room select {display:block;border:1px solid #aabfb2;border-radius:8px;color:var(--ink);background:#fff;font:inherit;padding:.6rem .8rem}
.study-room textarea {width:100%;min-height:5.2rem;box-sizing:border-box;resize:vertical;margin-bottom:.65rem}
.study-room select {max-width:100%;margin:.4rem 0 .9rem}
.study-picker {margin:1.1rem 0 .55rem;padding:.67rem .8rem;border:1px solid var(--line);border-radius:8px}
.study-picker summary {color:#235c4b;font-weight:650;cursor:pointer}
.study-sharing {background:#f4f7f3}
.study-sharing[hidden] {display:none}
.study-sharing[open] {padding:1rem}
.study-sharing p {margin:.7rem 0}
.study-sharing textarea {margin-top:.4rem}
.study-consent {display:flex;align-items:flex-start;gap:.55rem;margin:.9rem 0 1rem;line-height:1.45}
.study-consent input {flex:none;margin:.2rem 0;width:1.1rem;height:1.1rem;accent-color:var(--green)}
.study-picker fieldset {border:0;padding:0;margin:1rem 0 0}
.study-topics {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,215px),1fr));gap:.3rem .75rem;margin:.5rem 0}
.study-topics label {display:flex;align-items:center;gap:.5rem;padding:.3rem 0;font-size:.95rem}
.study-topics input {width:1.1rem;height:1.1rem;accent-color:var(--green)}
.study-topics label[hidden],.study-focus[hidden] {display:none}
.study-focus {border:0;padding:0;margin:1rem 0}
.study-focus legend {font-weight:650}
.study-focus small {font-weight:400;font-size:.92em}
.demo-label #composerMode {font-weight:inherit}
.study-actions {display:flex;gap:.5rem;flex-wrap:wrap}
.study-actions button:disabled {opacity:.65}
.study-actions+.study-tip {margin:.8rem 0 0}
.study-examples {margin:1.15rem 0}
.study-examples h2 {font-size:1.1rem;margin:.45rem 0 .65rem}
.study-entry,.study-room a {color:#225947;text-underline-offset:3px}
.study-entry {display:inline-block;font-weight:700;margin:.25rem 0 .45rem}
.study-result h2 {font:500 clamp(1.6rem,3vw,2.1rem)/1.2 var(--serif);margin:0}
.study-section {border-top:1px solid var(--line);margin:1.2rem 0;padding-top:1rem}
.study-section h3 {font-size:1.07rem;margin:0 0 .45rem}
.study-section p {margin:.5rem 0}
.study-citations {margin:.7rem 0 0;padding-left:1.25rem;color:#235c4b}
.study-citations li {padding:.15rem 0;line-height:1.45}
.study-citations a {font-weight:600}
.study-citations small {display:block;margin-top:.12rem;font-size:.88rem}

.study-result, .ai-result { container-type: inline-size; }
.study-reading-layout {
  display: grid;
  align-items: start;
  gap: 1.2rem;
  margin-top: 1.2rem;
}
.study-plain {
  min-width: 0;
  padding: 1rem 1.15rem;
  border: 1px solid #c3d6ca;
  border-radius: 12px;
  background: #eef4ee;
  color: #263e30;
  overflow-wrap: anywhere;
}
.study-plain h3 {
  margin: 0;
  font: 500 1.35rem/1.2 var(--serif);
  color: #284f3b;
}
.study-plain p { margin: .65rem 0 0; line-height: 1.55; color: inherit; }
.study-plain .study-plain-source { font-size: .88rem; font-weight: 600; }
.study-academic { min-width: 0; overflow-wrap: anywhere; }
.study-academic > .study-section:first-child { margin-top: 0; }
@container (min-width: 43rem) {
  .study-reading-layout { grid-template-columns: minmax(0, 1fr) minmax(15rem, 32%); gap: 1.6rem; }
  .study-plain { grid-column: 2; grid-row: 1; }
  .study-academic { grid-column: 1; grid-row: 1; }
}

.study-request-action {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  gap: 2px;
}
.study-request-action[hidden] { display: none; }
.study-request-action > button { min-width: 0; align-self: center; }
.study-pipe {
  display: inline-block;
  position: relative;
  flex: none;
  width: 72px;
  height: 54px;
  vertical-align: middle;
}
.study-pipe-stem {
  position: absolute;
  left: 28px;
  top: 14px;
  width: 43px;
  height: 30px;
  background: linear-gradient(145deg, #4b2e21 9%, #835132 47%, #bc834a 51%, #674127 58%, #41281d 78%);
  clip-path: path('M 0 22 C 12 20 22 4 37 1 Q 44 -1 42 3 C 26 7 16 24 0 29 Z');
}
.study-pipe-bowl {
  /* This crop is the acorn bowl in Berney’s original 960 × 960 portrait. */
  position: absolute;
  left: 5px;
  bottom: 2px;
  width: 33px;
  height: 34px;
  background: url('/berney-dormouse.webp') -17px -114px / 211.2px 211.2px no-repeat;
  clip-path: polygon(1% 36%, 5% 24%, 13% 13%, 29% 5%, 47% 2%, 62% 3%, 79% 8%, 90% 18%, 96% 30%, 99% 43%, 96% 54%, 89% 60%, 84% 74%, 72% 88%, 59% 96%, 48% 100%, 33% 94%, 18% 82%, 10% 67%, 8% 56%, 2% 49%);
}
.study-pipe-puff {
  position: absolute;
  bottom: 32px;
  left: 13px;
  width: 16px;
  height: 12px;
  border-radius: 80% 45% 75% 50%;
  background: #8b9e92;
  box-shadow: 5px -3px 0 -1px #8b9e92, 1px -6px 0 -2px #8b9e92;
  opacity: 0;
  animation: study-pipe-puff 2.4s ease-out infinite;
}
.study-pipe-puff:nth-last-child(2) { animation-delay: -.8s; }
.study-pipe-puff:last-child { animation-delay: -1.6s; }
@keyframes study-pipe-puff {
  0%   { opacity: 0; transform: translate(-1px, 5px) scale(.25); }
  18%  { opacity: .82; }
  62%  { opacity: .58; transform: translate(-4px, -9px) scale(.68); }
  100% { opacity: 0; transform: translate(6px, -19px) scale(.95); }
}
@media (prefers-reduced-motion: reduce) {
  .study-pipe-puff { animation: none; }
  .study-pipe-puff:last-child { opacity: .65; transform: translate(-2px, -5px) scale(.65); }
}
