.bodywrap:has(.ac) { min-height: 100dvh; background: rgb(15 14 22 / 97%); }
main:has(> .ac) { padding-inline: clamp(16px, 1.6vw, 29px); }
.ac { --ac-paper: #f4e8d2; --ac-rule: #aa9b79; --ac-jade: #b1d4c0; container: academy / inline-size; color: var(--ac-paper); }
.ac .pagehead { margin: 3px 1.6% clamp(22px, 2vw, 34px); }
.ac .pagehead h1 { color: var(--ac-paper); font: 600 var(--type-page)/1.22 var(--display); }
.ac .pagehead p { color: #dbd3c4; font-size: var(--type-body); line-height: 1.5; margin: 5px 0 0; }
.ac-shelf { --book-height: min(30.2cqi, 446px); --ac-gap: 1.55cqi; position: relative; isolation: isolate; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); column-gap: var(--ac-gap); padding-inline: 2.5%; }
.ac-tier { display: contents; }
.ac-shelf::before, .ac-tier::before { position: absolute; z-index: -1; left: 0; right: 0; top: calc(var(--book-height) - 3px); height: clamp(18px, 2.1cqi, 29px); background: url("../assets/academy/shelf.webp") center / 100% 100% no-repeat; }
.ac-shelf::before { content: ""; }
.ac-volume { position: relative; display: grid; justify-items: center; grid-template-rows: var(--book-height) auto; min-width: 0; color: var(--ac-paper); text-decoration: none; border-radius: 3px; }
.ac-jacket { display: block; position: relative; height: 100%; max-width: 100%; align-self: end; transition: transform 180ms ease-out; }
.ac-cover { display: block; height: 100%; width: auto; max-width: 100%; object-fit: contain; object-position: center bottom; }
.ac-mark { position: absolute; top: -1.4%; right: 4.9%; width: 8.8%; height: auto; pointer-events: none; }
.ac-volume[aria-current]::after { content: ""; position: absolute; top: calc(var(--book-height) + clamp(8px, .9cqi, 13px)); width: 83%; height: 4px; border-radius: 3px; background: var(--primary); }
.ac-volume:focus-visible { outline: 2px solid var(--ring); outline-offset: 4px; }
@media (hover:hover) {
  .ac-volume:hover .ac-jacket { transform: translateY(-5px); }
  .ac-volume:hover .ac-caption { color: var(--primary); }
}
.ac-caption { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; padding-top: clamp(26px, 3cqi, 43px); text-align: center; font: 500 var(--type-body)/1.5 var(--font-sans); }
.ac-count { color: #eee7d9; font: 400 var(--type-control)/1.3 var(--font-sans); font-variant-numeric: tabular-nums; }
.ac-count > span { margin-inline: 2px; color: #c7bfae; }
.ac-desk { position: relative; display: grid; grid-template-columns: minmax(0,1.52fr) minmax(280px,1fr); grid-template-rows: auto 1fr auto; column-gap: 4.25%; row-gap: 9px; min-height: clamp(257px, 26.6cqi, 354px); padding: 1.95% 2.9% 2.05% 10%; margin-top: clamp(18px, 1.95cqi, 28px); border: 1px solid #3d443c; border-radius: 10px; isolation: isolate; background: #252d26 url("../assets/academy/reading-landscape.webp") center / 100% 100% no-repeat; scroll-margin-top: calc(var(--topbar-height) + 10px); outline: none; }
.ac-situation { grid-column: 1; color: #e9ddbf; border-bottom: 1px solid var(--ac-rule); padding-bottom: 8px; font: 600 var(--type-card)/1.45 var(--display); }
.ac-to-shelf, .ac-mobile-course { display: none; }
.ac-lesson-intro { grid-area: 2 / 1; align-self: start; }
.ac-lesson-intro h2 { color: var(--ac-paper); font: 600 var(--type-feature)/1.26 var(--display); margin: 2px 0 6px; }
.ac-lesson-intro h3 { color: #eee2c8; font: 500 var(--type-card)/1.4 var(--display); margin: 0; }
.ac-lesson-intro p { margin: 4px 0 0; color: #e6decb; font-size: var(--type-body); line-height: 1.65; }
.ac-path { grid-area: 1 / 2 / 3; align-self: start; display: flex; list-style: none; margin: 8px -8px 0; padding: 0; }
.ac-path li { flex: 1; min-width: 0; position: relative; }
.ac-path li:not(:last-child)::before { content: ""; position: absolute; top: 16px; left: 50%; width: 100%; border-top: 1px solid #b8ad91; pointer-events: none; }
.ac-stop { position: relative; display: flex; width: 100%; min-height: 55px; align-items: center; flex-direction: column; gap: 7px; padding: 4px 0; background: none; border: 0; color: #e3d9be; cursor: pointer; font: 500 var(--type-control)/1.4 var(--font-sans); }
.ac-dot { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid #cbbf9d; border-radius: 50%; background: #252c25; }
.ac-stop.done .ac-dot { border: 2px solid #e6ddc7; color: #ece1c2; }
.ac-stop.next { color: #f3c273; }
.ac-stop.next .ac-dot { border: 2px solid currentColor; }
.ac-stop.next .ac-dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.ac-stop:hover, .ac-stop:focus-visible { color: #ffda92; text-decoration: underline; text-underline-offset: 4px; }
.ac-actions { grid-area: 3 / 1 / 4 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: clamp(14px, 2.8cqi, 39px); margin-top: 7px; }
.ac-actions .ac-read { justify-content: center; min-height: clamp(42px, 4.2cqi, 54px); padding-inline: clamp(18px, 2.25cqi, 34px); font-size: var(--type-control); }
.ac-apply, .ac-to-shelf { border: 0; background: none; color: var(--ac-jade); cursor: pointer; }
.ac-apply { display: inline-flex; gap: 5px; align-items: center; padding: 8px 0; min-height: 44px; font: 550 var(--type-control) var(--font-sans); }
.ac-apply:hover, .ac-to-shelf:hover { text-decoration: underline; text-underline-offset: 4px; }
.ac-no-project { color: #e0d9c9; font-size: 14px; }

#dialog:has(.ac-article), #dialog:has(.ac-project-context) { width: min(605px, calc(100% - 26px)); background: #1a201e; border-color: #4b5349; }
.ac-reader-byline { display: flex; gap: 12px; align-items: center; color: #ecdfc6; }
.ac-reader-byline img { height: 52px; width: auto; }
.ac-reader-byline strong { font: 600 var(--type-card)/1.4 var(--display); }
.ac-reader-byline p, .ac-reader-byline > span { margin: 0; color: #c2cabb; font: 13px/1.5 var(--font-sans); }
.ac-reader-byline > span { margin-left: auto; color: #acd2b8; }
.ac-article p.ac-course-description { color: #c3cbbf; font-size: 14px; margin: 10px 0 0; }
.ac-article .ac-key-idea { font: 500 var(--type-section)/1.65 var(--display); color: #f2e7cf; margin: 18px 0; padding-block: 14px; border-block: 1px solid #495043; }
.ac-article h3 { margin: 14px 0 4px; color: #d8bd8d; font: 600 15px/1.5 var(--font-sans); }
.ac-article h3 + p { color: #e0e0d7; margin: 0; font-size: 15px; line-height: 1.8; }
.ac-reread-actions, .ac-result-links { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; justify-content: flex-end; margin-top: 18px; padding-top: 14px; border-top: 1px solid #444c41; }
.ac-project-brief { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid #495043; }
.ac-project-brief > div { display: grid; grid-template-columns: max-content 1fr; gap: 14px; padding: 4px 0; }
.ac-project-brief dt { min-width: 4em; color: #b2bdaf; }
.ac-project-brief dd { color: #e7e5d8; margin: 0; }
@container academy (max-width: 850px) {
  .ac-desk { padding-left: 8%; column-gap: 2%; grid-template-columns: minmax(0,1.45fr) minmax(220px,1fr); }
  .ac-path { margin-right: 0; }
}
@container academy (max-width: 620px) {
  .ac .pagehead { margin: 0 0 18px; }
  .ac .pagehead p { font-size: 14px; }
  .ac-shelf { --book-height: min(47cqi, 222px); grid-template-columns: minmax(0,1fr); row-gap: 14px; padding: 0; }
  .ac-shelf::before { content: none; }
  .ac-tier { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5%; padding-inline: 3%; position: relative; isolation: isolate; }
  .ac-tier::before { content: ""; top: calc(var(--book-height) - 2px); height: 14px; }
  .ac-volume[aria-current]::after { top: calc(var(--book-height) + 5px); height: 3px; width: 70%; }
  .ac-caption { gap: 0; padding-top: 16px; font-size: 13px; }
  .ac-count { font-size: 14px; }
  .ac-desk { display: flex; flex-direction: column; gap: 12px; padding: 16px; margin-top: 18px; background-size: auto 100%; background-position: right bottom; }
  .ac-desk::before { content: ""; position: absolute; z-index: -1; inset: 0; border-radius: inherit; background: rgb(25 32 26 / 72%); }
  .ac-situation { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 0 6px; font-size: 16px; }
  .ac-mobile-course { display: inline; }
  .ac-to-shelf { display: inline-block; min-height: 36px; padding: 4px 0; font: 13px var(--font-sans); }
  .ac-lesson-intro { order: 1; }
  .ac-lesson-intro h2 { margin: 0;  }
  .ac-lesson-intro p { font-size: 14px; }
  .ac-path { order: 2; margin: 0; width: 100%; }
  .ac-actions { order: 3; gap: 20px; margin: 0; }
  .ac-actions .ac-read { min-height: 44px; }
}
@media (max-width: 480px) {
  main:has(> .ac) { padding-inline: 13px; }
}
