/* Atlas, Chronos and Panthéon share a catalogue layout and retain their accents. */
#module-atlas {
  --catalog-accent: var(--atlas-accent);
}

#module-chronos {
  --catalog-accent: var(--chronos-accent);
}

#module-pantheon {
  --catalog-accent: var(--pantheon-accent);
}

:is(#module-atlas, #module-chronos, #module-pantheon, #module-carnets) {
  --catalog-inset: clamp(1.05rem, 3vw, 2.65rem);
  --catalog-card-inset: clamp(0.9rem, 1.8vw, 1.5rem);
  --catalog-control-fill: color-mix(in srgb, var(--surface-2) 70%, transparent);
  min-width: 0;
}

:is(#module-atlas, #module-chronos, #module-pantheon) {
  --catalog-inset: clamp(0.9rem, 2vw, 1.75rem);
  --catalog-card-inset: clamp(0.75rem, 1.3vw, 1.15rem);
  --catalog-edge: var(--iris-module-edge, var(--glass-edge, transparent));
  --catalog-glass: var(--iris-module-glass, var(--glass-surface, var(--surface)));
  --catalog-card: var(--iris-module-card, var(--card-fill, var(--surface)));
  --catalog-highlight: var(--iris-module-highlight, var(--glass-sheen, none));
  --catalog-rule: color-mix(in srgb, var(--catalog-accent) 54%, transparent);
  gap: clamp(0.65rem, 1.3vw, 1.1rem);
}

:is(#module-atlas, #module-chronos, #module-pantheon) > .section-head,
#module-carnets .tm-workspace-head--compact {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(11rem, 1fr);
  align-items: end;
  gap: clamp(0.85rem, 2vw, 2rem);
  padding: clamp(0.9rem, 2.25vw, 2.5rem) 0 clamp(0.55rem, 1.8vw, 1.3rem);
  border: 0;
  border-radius: 0;
  background: transparent;
}

:is(#module-atlas, #module-chronos, #module-pantheon) .section-head__title,
#module-carnets .tm-workspace-head--compact h1 {
  max-width: 18ch;
  font: 650 clamp(2.4rem, 5vw, 5rem)/0.99 var(--display-font, var(--sans));
  letter-spacing: -0.055em;
  text-wrap: balance;
}

:is(#module-atlas, #module-chronos, #module-pantheon) .section-head__desc {
  max-width: 39ch;
  justify-self: end;
  color: var(--ink-2);
  font-size: clamp(0.82rem, 1.08vw, 0.98rem);
  line-height: 1.45;
}

:is(#module-atlas, #module-chronos, #module-pantheon) > .section-head {
  grid-template-columns: minmax(0, 1.65fr) minmax(11rem, 1fr);
  align-items: end;
  padding: clamp(0.2rem, 1vw, 0.9rem) 0 0.45rem;
}

:is(#module-atlas, #module-chronos, #module-pantheon) .section-head__title {
  max-width: none;
  font-size: clamp(1.8rem, 3.4vw, 3.75rem);
  line-height: 1.06;
  text-wrap: initial;
}

:is(#module-atlas, #module-chronos, #module-pantheon) .section-head__kicker {
  margin-bottom: 0.36rem;
}

:is(#atlas-grid, #chronos-layout, #pantheon-grid) {
  min-width: 0;
}

:is(#module-atlas, #module-chronos, #module-pantheon) :is(.tm-tech, .tm-atlas-world) {
  gap: clamp(0.55rem, 1.2vw, 1rem);
}

#module-atlas .tm-atlas-world .landing-title {
  max-width: 38ch;
  margin-top: 0.3rem;
  font: 600 clamp(1.2rem, 2.2vw, 2rem)/1.14 var(--sans);
  letter-spacing: -0.04em;
  text-wrap: balance;
}

:is(#module-atlas, #module-chronos, #module-pantheon) :is(.tm-atlas-system-board, .tm-chronos-hero, .tm-pantheon-archive) {
  gap: var(--catalog-inset);
  padding: var(--catalog-inset);
  border: 1px solid var(--catalog-edge);
  border-radius: var(--card-radius, 26px);
  background: var(--catalog-highlight), var(--catalog-card);
}

#module-atlas .tm-atlas-system-board {
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
}

#module-atlas .tm-atlas-system-board::before {
  opacity: 0.22;
}

#module-atlas .tm-atlas-visual-stack {
  grid-template-columns: minmax(0, 2fr) minmax(0, 0.7fr);
  gap: 0.7rem;
}

#module-atlas .tm-atlas-system-section {
  border-radius: calc(var(--card-radius, 26px) - 10px);
}

#module-atlas .tm-atlas-visual-stack .tm-module-visual {
  min-height: clamp(7rem, 12vw, 13rem);
}

:is(#module-atlas, #module-chronos, #module-pantheon) :is(.tm-atlas-system-copy > strong, .tm-module-intro-grid h3) {
  max-width: 25ch;
  color: var(--ink);
  font: 500 clamp(1.6rem, 2.8vw, 2.85rem)/1.04 var(--serif);
  letter-spacing: -0.035em;
  text-wrap: balance;
}

:is(#module-atlas, #module-chronos, #module-pantheon) :is(.tm-atlas-system-copy p:not(.tm-tech-kicker), .tm-tech-muted) {
  color: var(--ink-2);
  font-size: 0.88rem;
  line-height: 1.6;
}

:is(#module-chronos, #module-pantheon) .tm-module-intro-grid {
  column-gap: var(--catalog-inset);
  row-gap: 0.75rem;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  align-items: stretch;
}

:is(#module-atlas, #module-chronos, #module-pantheon) :is(.tm-atlas-board-media, .tm-chronos-hero-media, .tm-pantheon-hero-media) {
  min-height: clamp(7.5rem, 13vw, 14rem);
  border-radius: calc(var(--card-radius, 26px) - 8px);
  border: 0;
  box-shadow: none;
}

:is(#module-atlas, #module-chronos, #module-pantheon) :is(.tm-atlas-board-media, .tm-chronos-hero-media, .tm-pantheon-hero-media) img {
  position: absolute;
  inset: 0;
  aspect-ratio: auto;
}

#module-pantheon .tm-module-intro-grid {
  grid-template-areas: "eyebrow media" "title media" "movements movements";
  grid-template-rows: auto 1fr auto;
}

:is(#module-chronos, #module-pantheon) .tm-module-intro-grid > div {
  display: contents;
}

:is(#module-chronos, #module-pantheon) .tm-module-intro-grid .tm-tech-kicker { grid-area: eyebrow; }
:is(#module-chronos, #module-pantheon) .tm-module-intro-grid h3 { grid-area: title; }
:is(#module-chronos, #module-pantheon) .tm-module-visual { grid-area: media; }
#module-pantheon .tm-pantheon-movement-nav { grid-area: movements; }

#module-chronos .tm-module-intro-grid {
  grid-template-areas: "eyebrow media" "title media" "description media" "timeline timeline" "stats stats";
  grid-template-rows: auto auto 1fr auto auto;
}

#module-chronos .tm-module-intro-grid .tm-tech-muted { grid-area: description; }
#module-chronos .tm-chronos-track { grid-area: timeline; }
#module-chronos .tm-chronos-spine__stats { grid-area: stats; }

:is(#module-chronos, #module-pantheon) .tm-module-intro-grid .tm-module-visual {
  margin-block-start: calc(var(--catalog-inset) * -1);
  margin-inline-end: calc(var(--catalog-inset) * -1);
  border-radius: 0 calc(var(--card-radius, 26px) - 1px) 0 calc(var(--card-radius, 26px) - 6px);
}

#module-atlas .tm-atlas-system-stats {
  gap: 0;
  padding-block: 0.45rem;
  border-block: 1px solid var(--glass-edge, transparent);
}

#module-atlas .tm-atlas-system-stat {
  padding: clamp(0.35rem, 1vw, 0.7rem);
  border: 0;
  border-radius: 0;
  background: transparent;
}

#module-atlas .tm-atlas-system-stat + .tm-atlas-system-stat {
  border-inline-start: 1px solid var(--glass-edge, transparent);
}

#module-atlas .tm-atlas-system-stat strong {
  color: var(--ink);
  font: 600 clamp(1.35rem, 2.5vw, 2.35rem)/1 var(--sans);
  letter-spacing: -0.055em;
}

#module-atlas .tm-atlas-system-stat span {
  margin-top: 0.3rem;
  font-size: 0.66rem;
  white-space: normal;
  overflow-wrap: anywhere;
}

#module-atlas .tm-atlas-material-track {
  background: var(--surface-3);
}

#module-chronos .tm-chronos-track {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.5rem;
  margin-block: 0.6rem 0.15rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--glass-edge, transparent);
}

#module-chronos .tm-chronos-track::before {
  content: none;
}

#module-chronos .tm-chronos-era {
  align-content: start;
  gap: .25rem;
  padding: .55rem .35rem;
}

#module-chronos .tm-chronos-era::before {
  position: static;
  width: 6px;
  height: 6px;
  margin-bottom: 0.2rem;
  border: 0;
  background: var(--catalog-accent);
  box-shadow: none;
}

#module-chronos .tm-chronos-era strong {
  color: var(--ink);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

#module-chronos .tm-chronos-era small {
  font-size: 0.7rem;
  overflow-wrap: anywhere;
}

#module-pantheon .tm-pantheon-movement-nav {
  flex-wrap: nowrap;
  gap: 0.55rem;
  min-width: 0;
  margin-top: 0.7rem;
  padding: 0.28rem 0.15rem 0.55rem;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}

#module-pantheon .tm-pantheon-movement-nav .tm-tech-chip {
  flex: 0 0 auto;
  max-width: min(100%, 17rem);
}

/* Keep the search and filters compact without clipping quick-filter buttons. */
:is(#module-atlas, #module-chronos, #module-pantheon) .tm-tech-controls,
#module-carnets .tm-carnets-toolbar {
  border: 1px solid var(--catalog-edge, var(--glass-edge, transparent));
  border-radius: var(--card-radius, 26px);
  background: var(--catalog-highlight, var(--glass-sheen, none)), var(--catalog-glass, var(--glass-surface, var(--surface)));
  -webkit-backdrop-filter: blur(var(--glass-blur, 18px));
  backdrop-filter: blur(var(--glass-blur, 18px));
}

:is(#module-atlas, #module-chronos, #module-pantheon) .tm-tech-controls {
  display: grid;
  grid-template-columns: minmax(11rem, 1.6fr) repeat(5, minmax(0, 1fr));
  align-items: start;
  gap: 0.55rem;
  padding: clamp(0.55rem, 1.05vw, 0.82rem);
}

:is(#module-atlas, #module-chronos, #module-pantheon) .tm-tech-controls > * {
  min-width: 0;
}

:is(#module-atlas, #module-chronos, #module-pantheon) .tm-tech-controls .field {
  min-height: 44px;
  justify-content: center;
  gap: 0.23rem;
  padding: 0.48rem 0.72rem;
  border-color: var(--catalog-edge);
  border-radius: var(--r-pill);
  background: var(--catalog-control-fill);
}

:is(#module-atlas, #module-chronos, #module-pantheon) .tm-tech-controls .tm-tech-search {
  grid-column: auto;
}

:is(#module-atlas, #module-chronos, #module-pantheon) .tm-tech-controls .field:focus-within {
  border-color: var(--gold);
}

:is(#module-atlas, #module-chronos, #module-pantheon) .tm-tech-controls :is(input, select) {
  width: 100%;
  color: var(--ink);
  font-size: 0.85rem;
}

#module-chronos .tm-tech-controls {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

:is(#module-chronos, #module-pantheon) .tm-tech-controls .tm-tech-chip-row {
  flex-wrap: nowrap;
  align-items: center;
  max-height: none;
  min-width: 0;
  padding: 2px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}

:is(#module-chronos, #module-pantheon) .tm-tech-controls .tm-tech-chip-row:empty {
  display: none;
}

:is(#module-chronos, #module-pantheon) .tm-tech-controls .tm-tech-chip-row .tm-tech-chip {
  flex: 0 0 auto;
  max-width: none;
  white-space: nowrap;
}

:is(#module-chronos, #module-pantheon) .tm-tech-chip {
  max-width: 100%;
  min-height: 34px;
  padding: 0.35rem 0.8rem;
  border-radius: var(--r-pill);
  border-color: var(--catalog-edge);
  background: var(--catalog-control-fill);
  color: var(--ink-2);
  font-size: 0.73rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  overflow-wrap: anywhere;
}

:is(#module-chronos, #module-pantheon) .tm-tech-chip:is(.is-active, :hover) {
  border-color: color-mix(in srgb, var(--gold) 35%, transparent);
  background: var(--gold-glow);
  color: var(--ink);
}

#module-chronos .tm-tech-compare {
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.57rem 0.9rem;
  border-color: var(--catalog-edge);
  border-radius: calc(var(--card-radius, 26px) - 7px);
  background: var(--catalog-highlight), var(--catalog-card);
}

#module-chronos .tm-tech-compare > div:first-child {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.6rem;
}

#module-chronos .tm-tech-compare > div:first-child strong {
  font-size: 0.82rem;
  font-weight: 600;
}

#module-chronos .tm-tech-compare > .tm-tech-muted {
  font-size: 0.75rem;
  line-height: 1.36;
}

#module-chronos .tm-tech-compare-grid {
  grid-column: 1 / -1;
}

/* Preserve scroll snapping and the runtime's selected and expanded card sizes. */
:is(#module-atlas, #module-chronos, #module-pantheon) .tm-focus-rail-head {
  flex-direction: row;
  align-items: center;
  gap: 0.65rem;
  padding: 0.14rem 0;
}

#module-atlas .tm-atlas-focus-head {
  margin-top: 0.28rem;
}

:is(#module-atlas, #module-chronos, #module-pantheon) .tm-focus-rail-actions {
  flex: 0 0 auto;
  gap: 0.13rem;
  padding: 0.15rem;
  border: 1px solid var(--catalog-edge);
  border-radius: var(--r-pill);
  background: var(--catalog-highlight), var(--catalog-glass);
}

:is(#module-atlas, #module-chronos, #module-pantheon) .tm-focus-rail-actions button {
  width: 44px;
  height: 44px;
  border-color: transparent;
  border-radius: 50%;
  background: transparent;
}

:is(#module-atlas, #module-chronos, #module-pantheon) :is(.tm-atlas-world-card, .tm-tech-card) {
  border-color: var(--catalog-edge);
  border-radius: var(--card-radius, 26px);
  background: var(--catalog-highlight), var(--catalog-card);
  opacity: 1;
  filter: none;
}

:is(#module-atlas, #module-chronos, #module-pantheon) :is(.tm-atlas-world-card.is-selected, .tm-tech-card.is-active) {
  border-color: var(--catalog-rule);
  box-shadow: 0 9px 28px rgba(0, 0, 0, 0.2);
}

#module-atlas .tm-real-photo--atlas-card {
  height: clamp(6rem, 10vw, 10rem);
  border-radius: 0;
}

#module-atlas .tm-atlas-world-card.is-selected .tm-real-photo--atlas-card {
  height: clamp(8.5rem, 13vw, 12.5rem);
}

#module-atlas .tm-atlas-world-card.is-selected,
#module-atlas .tm-atlas-world-card.is-selected > .tm-atlas-card-select,
:is(#module-chronos, #module-pantheon) .tm-tech--focus-rail .tm-tech-card.is-active {
  min-height: 0;
}

#module-atlas .tm-atlas-card-focus {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
}

#module-atlas .tm-atlas-world-grid {
  position: relative;
  margin-block: 0.22rem 0.55rem;
}

:is(#module-chronos, #module-pantheon) .tm-tech--focus-rail .tm-tech-grid,
#module-atlas .tm-atlas-world-grid {
  padding-block: 0.25rem 0.8rem;
}

#module-chronos .tm-tech--focus-rail .tm-chronos-timeline::before {
  top: 0.1rem;
}

:is(#module-atlas, #module-chronos, #module-pantheon) :is(.tm-tech-card-body, .tm-atlas-card-select, .tm-atlas-world-card.is-selected > .tm-atlas-card-select) {
  gap: 0.58rem;
  padding: var(--catalog-card-inset);
}

#module-atlas .tm-atlas-card-select > .tm-atlas-card-visual {
  width: auto;
  margin: calc(var(--catalog-card-inset) * -1) calc(var(--catalog-card-inset) * -1) 0.1rem;
}

:is(#module-atlas, #module-chronos, #module-pantheon) :is(.tm-atlas-card-select > strong, .tm-tech-card h3) {
  color: var(--ink);
  font: 650 clamp(1.15rem, 1.9vw, 1.65rem)/1.14 var(--sans);
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}

:is(#module-atlas, #module-chronos, #module-pantheon) :is(.tm-atlas-world-card.is-selected .tm-atlas-card-select > strong, .tm-tech-card.is-active h3) {
  font-size: clamp(1.3rem, 2.55vw, 2.05rem);
}

:is(#module-atlas, #module-chronos, #module-pantheon) :is(.tm-atlas-card-select > small, .tm-tech-card-body > p) {
  color: var(--ink-2);
  font-size: 0.88rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

:is(#module-atlas, #module-chronos, #module-pantheon) :is(.tm-tech-tag, .tm-tech-badges span) {
  max-width: 100%;
  border-radius: var(--r-pill);
  white-space: normal;
  overflow-wrap: anywhere;
}

:is(#module-atlas, #module-chronos, #module-pantheon) .tm-tech-badges span {
  color: var(--ink-2);
  font-size: 0.67rem;
  letter-spacing: 0.02em;
  text-transform: none;
}

:is(#module-atlas, #module-chronos, #module-pantheon) :is(.tm-atlas-card-open-hint, .tm-tech-card-open-hint) {
  width: auto;
  justify-self: start;
  min-height: 44px;
  margin: 0 1rem 1rem;
  padding: 0.52rem 0.9rem;
  border: 1px solid var(--glass-edge, transparent);
  border-radius: var(--r-pill);
  background: var(--catalog-control-fill);
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

:is(#module-atlas, #module-chronos, #module-pantheon, #module-carnets) :is(
  .tm-tech-chip, .tm-focus-rail-actions button, .tm-atlas-card-open-hint, .tm-tech-card-open-hint,
  .tm-carnet-item, .tm-carnet-mobile-nav button, .tm-segmented button
) {
  transition: color 180ms var(--ease-interface, ease), background-color 180ms var(--ease-interface, ease), border-color 180ms var(--ease-interface, ease);
}

:is(#module-atlas, #module-chronos, #module-pantheon) :is(.tm-atlas-card-open-hint, .tm-tech-card-open-hint):hover {
  border-color: var(--gold);
  background: var(--gold-glow);
}

:is(#module-atlas, #module-chronos, #module-pantheon) :is(.tm-tech-chip, .tm-focus-rail-actions button, .tm-tech-card, .tm-atlas-card-select):focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
}

:is(#module-atlas, #module-chronos, #module-pantheon) :is(.tm-atlas-inline-detail, .tm-tech-inline-detail) .tm-knowledge-v2 {
  font-size: 0.86rem;
}

:is(#module-atlas, #module-chronos, #module-pantheon) :is(.tm-atlas-inline-detail, .tm-tech-inline-detail) {
  gap: 1rem;
  margin-inline: var(--catalog-card-inset);
  padding-top: var(--catalog-card-inset);
  border-top-color: var(--glass-edge, transparent);
}

/* Carnets keeps its three-pane workspace and the existing mobile pane switcher. */
#module-carnets .tm-carnets-space {
  gap: clamp(1rem, 2.2vw, 2rem);
}

#module-carnets .tm-workspace-head--compact {
  grid-template-columns: minmax(0, 1fr) auto;
}

#module-carnets .tm-workspace-head--compact .tm-workspace-command {
  min-height: 44px;
  padding-inline: 1.15rem;
  border-radius: var(--r-pill);
  background: var(--catalog-control-fill);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

#module-carnets .tm-carnets-toolbar {
  grid-template-columns: minmax(0, 1fr) auto auto;
  column-gap: 0.75rem;
  row-gap: 0.6rem;
  padding: clamp(0.7rem, 1.5vw, 1rem);
}

#module-carnets .tm-carnets-export {
  grid-column: auto;
  border: 0;
}

#module-carnets .tm-carnets-export[open] {
  grid-column: 1 / -1;
}

#module-carnets .tm-carnets-export > summary {
  min-height: 48px;
  gap: 0.65rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--glass-edge, transparent);
  border-radius: var(--r-pill);
  background: var(--catalog-control-fill);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

#module-carnets .tm-carnets-export > summary:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

#module-carnets :is(.tm-carnets-search input, .tm-carnet-editor input, .tm-carnet-editor select, .tm-carnet-editor textarea) {
  min-height: 44px;
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.88rem;
}

#module-carnets .tm-carnets-search input {
  min-height: 48px;
  padding-inline: 1rem;
  border-color: var(--glass-edge, transparent);
  border-radius: var(--r-pill);
  background: var(--catalog-control-fill);
}

#module-carnets .tm-carnet-editor textarea {
  line-height: 1.65;
}

#module-carnets .tm-segmented {
  align-items: center;
  min-height: 48px;
  padding: 0.25rem;
  border-color: var(--glass-edge, transparent);
  border-radius: var(--r-pill);
  background: var(--catalog-control-fill);
}

#module-carnets .tm-segmented button {
  min-height: 40px;
  border-radius: var(--r-pill);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

#module-carnets .tm-carnets-layout {
  gap: clamp(0.55rem, 1vw, 0.9rem);
  grid-template-columns: minmax(0, 0.76fr) minmax(0, 0.95fr) minmax(0, 1.38fr);
  border: 0;
}

#module-carnets :is(.tm-carnet-nav, .tm-carnets-results, .tm-carnet-detail) {
  padding: clamp(0.75rem, 1.65vw, 1.55rem);
  border: 1px solid var(--glass-edge, transparent);
  border-radius: var(--card-radius, 26px);
  background: var(--card-fill, var(--surface));
}

#module-carnets .tm-carnet-nav {
  grid-template-columns: minmax(0, 1fr);
}

#module-carnets :is(.tm-carnet-new, .tm-carnet-tabs-head) {
  border-radius: var(--r-pill);
}

#module-carnets .tm-carnet-tabs-head {
  border-color: transparent;
  background: transparent;
}

#module-carnets .tm-carnet-new {
  justify-content: flex-start;
  min-height: 48px;
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

#module-carnets .tm-carnet-nav :is(.tm-carnet-tabs, .tm-carnet-project-filters, .tm-carnet-utilities) > button,
#module-carnets .tm-carnet-tab-select {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-size: 0.78rem;
}

#module-carnets .tm-carnet-nav button[aria-pressed="true"] {
  border-color: var(--gold-dim);
  background: var(--gold-glow);
  color: var(--ink);
  font-weight: 650;
}

#module-carnets .tm-carnet-project-filters button > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

#module-carnets .tm-carnet-utilities > button {
  white-space: normal;
  overflow-wrap: anywhere;
}

[data-theme="light"] #module-carnets .tm-carnet-new {
  color: var(--surface) !important;
}

[data-theme="light"] #module-carnets :is(.tm-segmented button[aria-pressed="true"], .tm-carnet-tab-form button[type="submit"], .tm-carnet-tab-rename button[type="submit"]) {
  color: var(--surface);
}

#module-carnets .tm-carnets-results .tm-section-line {
  padding-bottom: 0.7rem;
  border-bottom: var(--border);
}

#module-carnets .tm-carnets-results .tm-section-line h2 {
  font: 650 clamp(1.2rem, 2vw, 1.8rem)/1.12 var(--sans);
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}

#module-carnets .tm-carnet-item {
  border-radius: calc(var(--card-radius, 26px) - 5px);
  background: var(--surface);
}

#module-carnets .tm-carnet-item.is-active {
  border-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 7%, var(--surface-2));
}

#module-carnets .tm-carnet-item > button {
  gap: 0.35rem;
  min-height: 44px;
  padding: 0.85rem;
}

#module-carnets .tm-carnet-item h3 {
  font: 650 1rem/1.15 var(--sans);
  letter-spacing: -0.025em;
}

#module-carnets .tm-carnet-item :is(p, time) {
  color: var(--ink-2);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

#module-carnets .tm-carnet-detail__head h2 {
  font: 650 clamp(1.5rem, 2.65vw, 2.5rem)/1.08 var(--sans);
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}

#module-carnets .tm-carnet-items .tm-workspace-empty {
  grid-column: 1 / -1;
}

@media (max-width: 820px) {
  :is(#module-atlas, #module-chronos, #module-pantheon) > .section-head {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  :is(#module-atlas, #module-chronos, #module-pantheon) .section-head__desc {
    justify-self: start;
  }

  :is(#module-atlas, #module-pantheon) .tm-tech-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  :is(#module-atlas, #module-pantheon) .tm-tech-controls .tm-tech-search {
    grid-column: 1 / -1;
  }

  #module-chronos .tm-tech-compare {
    grid-template-columns: minmax(0, 1fr);
  }

  #module-atlas .tm-atlas-system-board,
  :is(#module-chronos, #module-pantheon) .tm-module-intro-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  #module-pantheon .tm-module-intro-grid {
    grid-template-areas: "eyebrow" "title" "media" "movements";
    grid-template-rows: auto;
  }

  #module-chronos .tm-module-intro-grid {
    grid-template-areas: "eyebrow" "title" "description" "media" "timeline" "stats";
    gap: 0.8rem;
  }

  :is(#module-chronos, #module-pantheon) .tm-module-intro-grid .tm-module-visual {
    margin-block-start: 0;
    margin-inline-end: 0;
    border-radius: calc(var(--card-radius, 26px) - 8px);
  }

  #module-chronos .tm-chronos-track {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #module-carnets .tm-carnets-toolbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  #module-carnets .tm-carnets-search {
    grid-column: 1 / -1;
  }

  #module-carnets .tm-carnet-mobile-nav {
    padding: 0.25rem;
    border: 1px solid var(--glass-edge, transparent);
    border-radius: var(--r-pill);
    background: var(--glass-sheen, none), var(--glass-surface, var(--surface));
  }

  #module-carnets .tm-carnet-mobile-nav button {
    border: 0;
    border-radius: var(--r-pill);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
  }

  #module-carnets .tm-carnets-layout {
    grid-template-columns: minmax(0, 1fr);
    min-height: 16rem;
  }
}

@media (max-width: 640px) {
  :is(#module-atlas, #module-chronos, #module-pantheon) > .section-head {
    gap: 0.42rem;
  }

  :is(#module-atlas, #module-chronos, #module-pantheon) .section-head__title {
    font-size: clamp(1.7rem, 6.5vw, 2.15rem);
  }

  :is(#module-atlas, #module-pantheon) .tm-tech-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
  }

  :is(#module-atlas, #module-pantheon) .tm-tech-controls .field {
    padding-inline: 0.5rem;
  }

  #module-atlas .tm-atlas-world-controls .field select {
    padding-inline: 0.1rem;
    font-size: 0.73rem;
    letter-spacing: -0.015em;
  }

  #module-chronos .tm-tech-controls {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.66fr);
  }

  #module-atlas .tm-atlas-world-card,
  #module-atlas .tm-atlas-world-card.is-selected {
    flex-basis: min(calc(100vw - 3rem), 360px);
    transform: none;
  }

  #module-atlas .tm-real-photo--atlas-card,
  #module-atlas .tm-atlas-world-card.is-selected .tm-real-photo--atlas-card {
    height: 6.4rem;
  }

  :is(#module-atlas, #module-chronos, #module-pantheon) .tm-tech-controls :is(input, select),
  #module-carnets :is(.tm-carnets-search input, .tm-carnet-editor input, .tm-carnet-editor select, .tm-carnet-editor textarea) {
    font-size: 1rem;
  }

  :is(#module-atlas, #module-pantheon) .tm-tech-controls .field select {
    text-overflow: ellipsis;
  }

  #module-atlas .tm-atlas-system-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #module-atlas .tm-atlas-visual-stack {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  }

  :is(#module-chronos, #module-pantheon) .tm-tech-chip {
    min-height: 44px;
  }

  #module-carnets .tm-workspace-head--compact {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.8rem;
  }

  #module-carnets .tm-workspace-head--compact .tm-workspace-head__action {
    justify-content: flex-start;
  }

  #module-carnets .tm-workspace-head--compact .tm-workspace-command {
    flex: 0 1 auto;
  }
}

/* Keep the entry action with its badge when vertical space is scarce. */
@media (max-width: 640px), (max-height: 950px) {
  #module-atlas .tm-atlas-world-card.is-selected {
    --atlas-card-photo-height: 6.4rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  #module-atlas .tm-atlas-world-card.is-selected .tm-real-photo--atlas-card {
    height: var(--atlas-card-photo-height);
  }

  #module-atlas .tm-atlas-world-card.is-selected > .tm-atlas-card-select,
  #module-atlas .tm-atlas-world-card.is-selected > .tm-atlas-card-open-hint {
    grid-area: 1 / 1;
  }

  #module-atlas .tm-atlas-world-card.is-selected .tm-atlas-card-select > .tm-technical-badge {
    max-width: calc(100% - 9.1rem);
    min-height: 44px;
    align-items: center;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  #module-atlas .tm-atlas-card-open-hint {
    z-index: 1;
    align-self: start;
    justify-self: end;
    margin: var(--catalog-card-inset) var(--catalog-card-inset) 0 0;
    padding-inline: 0.65rem;
  }

  #module-atlas .tm-atlas-world-card.is-selected > .tm-atlas-card-open-hint {
    margin-block-start: calc(var(--atlas-card-photo-height) + 0.68rem);
  }

}

/* Chronos shows a landscape. The active Panthéon entry pairs a portrait with its reading card. */
:is(#module-chronos, #module-pantheon) .tm-tech--focus-rail .tm-knowledge-gallery-card {
  --gallery-visual-height: clamp(7.25rem, 13vw, 10.25rem);
  display: grid;
  grid-template: var(--gallery-visual-height) auto / minmax(0, 1fr);
  min-height: 0;
  transform: none;
  background: var(--catalog-highlight), var(--catalog-card);
}

:is(#module-chronos, #module-pantheon) .tm-tech--focus-rail .tm-knowledge-gallery-card.is-active {
  --gallery-visual-height: clamp(8rem, 15vw, 13rem);
  border-color: color-mix(in srgb, var(--gold) 65%, var(--catalog-edge));
}

:is(#module-chronos, #module-pantheon) .tm-knowledge-gallery-card .tm-knowledge-gallery-card__visual {
  min-height: 0;
  min-width: 0;
  height: 100%;
  isolation: isolate;
  color: var(--gold);
  border-color: var(--catalog-edge);
  background:
    repeating-linear-gradient(90deg, transparent 0 35px, color-mix(in srgb, var(--gold) 12%, transparent) 35px 36px),
    radial-gradient(ellipse at 80% 100%, color-mix(in srgb, var(--gold) 20%, transparent), transparent 65%),
    var(--surface);
}

:is(#module-chronos, #module-pantheon) .tm-knowledge-gallery-card__visual .tm-real-photo:is(.is-unavailable, .is-pending) {
  background: transparent;
}

:is(#module-chronos, #module-pantheon) .tm-knowledge-gallery-card__visual .tm-real-photo {
  position: absolute;
  inset: 0;
}

:is(#module-chronos, #module-pantheon) .tm-knowledge-gallery-card__visual .tm-real-photo:not(.is-unavailable, .is-pending) ~ .tm-real-photo__glyph {
  display: none;
}

:is(#module-chronos, #module-pantheon) .tm-knowledge-gallery-card__visual .tm-real-photo img {
  filter: saturate(0.9);
  transform: none;
}

:is(#module-chronos, #module-pantheon) .tm-knowledge-gallery-card__visual .tm-real-photo::after {
  background: linear-gradient(180deg, rgba(5, 5, 5, 0.09), transparent 42%, rgba(5, 5, 5, 0.23));
}

#module-pantheon .tm-knowledge-gallery-card__visual .tm-real-photo img {
  object-position: center 4%;
}

.tm-knowledge-gallery-card__date {
  position: absolute;
  z-index: 2;
  inset: auto 0.65rem 0.65rem auto;
  max-width: calc(100% - 1.3rem);
  padding: 0.42rem 0.68rem;
  border: 1px solid rgba(245, 245, 241, 0.24);
  border-radius: var(--r-pill);
  color: #f5f5f1;
  background: rgba(5, 5, 5, 0.78);
  font: 600 0.73rem/1.3 var(--sans);
  font-variant-numeric: tabular-nums;
}

#module-chronos .tm-knowledge-gallery-card__visual .tm-real-photo__glyph {
  inset: auto auto 0.35rem 0.5rem;
}

:is(#module-chronos, #module-pantheon) .tm-knowledge-gallery-card .tm-knowledge-gallery-card__body {
  display: grid;
  align-content: start;
  gap: 0.65rem;
  min-height: 0;
  min-width: 0;
  padding: var(--catalog-card-inset);
}

:is(#module-chronos, #module-pantheon) .tm-knowledge-gallery-card .tm-knowledge-gallery-card__heading h3 {
  margin: 0;
  color: var(--ink);
  font: 600 clamp(1.75rem, 2.3vw, 2.4rem)/1.01 var(--serif);
  letter-spacing: -0.028em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

:is(#module-chronos, #module-pantheon) .tm-knowledge-gallery-card.is-active .tm-knowledge-gallery-card__heading h3 {
  font-size: clamp(2rem, 3.25vw, 3.05rem);
}

:is(#module-chronos, #module-pantheon) .tm-knowledge-gallery-card .tm-knowledge-gallery-card__meta {
  margin: 0 0 0.28rem;
  color: var(--gold);
  font: 625 0.7rem/1.35 var(--sans);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.tm-knowledge-gallery-card__facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem 0.75rem;
  margin: 0;
  padding: 0.52rem 0 0;
  border-block-start: 1px solid var(--catalog-edge);
  overflow-wrap: anywhere;
}

.tm-knowledge-gallery-card__facts dt {
  color: var(--ink-2);
  font: 525 0.68rem/1.35 var(--sans);
}

.tm-knowledge-gallery-card__facts dd {
  margin: 0.15rem 0 0;
  color: var(--ink);
  font: 625 0.85rem/1.35 var(--sans);
}

:is(#module-chronos, #module-pantheon) .tm-knowledge-gallery-card .tm-knowledge-gallery-card__note {
  margin: 0;
  color: var(--ink-2);
  font: 450 0.86rem/1.42 var(--sans);
}

:is(#module-chronos, #module-pantheon) .tm-knowledge-gallery-card .tm-tech-badges {
  min-height: 0;
  margin: 0;
}

.tm-knowledge-gallery-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.36rem;
}

:is(#module-chronos, #module-pantheon) .tm-knowledge-gallery-card__actions :is(.tm-tech-card-open-hint, .tm-knowledge-gallery-card__compare) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: auto;
  min-height: 44px;
  margin: 0;
  padding: 0.45rem 0.76rem;
  border: 1px solid var(--catalog-edge);
  border-radius: var(--r-pill);
  background: var(--catalog-control-fill);
  color: var(--ink);
  font: 625 0.76rem/1.2 var(--sans);
}

:is(#module-chronos, #module-pantheon) .tm-knowledge-gallery-card__actions .tm-tech-card-open-hint {
  border-color: color-mix(in srgb, var(--gold) 48%, var(--catalog-edge));
  background: color-mix(in srgb, var(--gold) 18%, var(--catalog-card));
}

:is(#module-chronos, #module-pantheon) .tm-knowledge-gallery-card__actions :is(button:hover, button[aria-pressed="true"]) {
  border-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 28%, var(--catalog-card));
  color: var(--ink);
}

:is(#module-chronos, #module-pantheon) .tm-tech--focus-rail .tm-knowledge-gallery-card:focus-visible,
.tm-knowledge-gallery-card__compare:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -3px;
}

@media (min-width: 1024px) {
  #module-pantheon .tm-tech--focus-rail .tm-knowledge-gallery-card.is-active {
    grid-template: minmax(clamp(19rem, 25vw, 23.5rem), auto) / minmax(0, 0.78fr) minmax(0, 1fr);
  }

  #module-pantheon .tm-knowledge-gallery-card.is-active .tm-knowledge-gallery-card__visual {
    border-block-end: 0;
    border-inline-end: 1px solid var(--catalog-edge);
  }

  #module-pantheon .tm-knowledge-gallery-card.is-active .tm-knowledge-gallery-card__body {
    align-content: center;
  }

  #module-pantheon .tm-knowledge-gallery-card.is-active .tm-knowledge-gallery-card__facts {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 767px) {
  :is(#module-chronos, #module-pantheon) .tm-tech--focus-rail .tm-knowledge-gallery-card.is-active {
    --gallery-visual-height: clamp(7.25rem, 36vw, 10rem);
  }
}

@media (max-width: 420px) {
  #module-chronos .tm-chronos-track {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  :is(#module-atlas, #module-chronos, #module-pantheon, #module-carnets) :is(
    .tm-tech-chip, .tm-focus-rail-actions button, .tm-atlas-card-open-hint, .tm-tech-card-open-hint,
    .tm-carnet-item, .tm-carnet-mobile-nav button, .tm-segmented button
  ) {
    transition: none;
  }
}

/* The modal owns a single scrollable reading area. */
:root {
  --knowledge-dock-width: clamp(18rem, 32vw, 43rem);
}

.tm-knowledge-drawer {
  --drawer-inset: clamp(1rem, 2.4vw, 2rem);
  --drawer-edge: var(--iris-module-edge, var(--glass-edge));
  --drawer-sheen: var(--iris-module-highlight, var(--glass-sheen));
  --drawer-fill: color-mix(in srgb, var(--surface) 94%, transparent);
  --drawer-top: calc(var(--topbar-h, 68px) + 0.7rem);
  --drawer-edge-gap: 0.7rem;
  position: fixed;
  inset: var(--drawer-top) var(--drawer-edge-gap) auto auto;
  width: min(46rem, calc(100% - var(--sidebar-w, 228px) - 2rem));
  height: calc(100vh - var(--drawer-top) - var(--drawer-edge-gap));
  height: calc(100dvh - var(--drawer-top) - var(--drawer-edge-gap));
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--drawer-edge);
  border-radius: var(--r-xl);
  background: var(--surface);
  background: var(--drawer-sheen), var(--drawer-fill);
  color: var(--ink);
  -webkit-backdrop-filter: blur(var(--glass-blur, 22px));
  backdrop-filter: blur(var(--glass-blur, 22px));
  box-shadow: -18px 12px 68px rgba(5, 5, 5, 0.26);
}

.tm-knowledge-drawer::backdrop {
  background: rgba(5, 5, 5, 0.19);
}

.tm-knowledge-drawer__panel {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}

.tm-knowledge-drawer__header {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: clamp(0.65rem, 2vw, 1.2rem);
  padding: var(--drawer-inset);
  border-bottom: 1px solid var(--drawer-edge);
  background: color-mix(in srgb, var(--surface) 52%, transparent);
}

.tm-knowledge-drawer__eyebrow {
  margin: 0 0 0.38rem;
  color: var(--gold);
  font: 650 0.7rem/1.3 var(--sans);
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.tm-knowledge-drawer__header h2 {
  margin: 0;
  color: var(--ink);
  font: 625 clamp(1.45rem, 3.5vw, 2.75rem)/1.07 var(--display-font, var(--sans));
  letter-spacing: -0.048em;
  overflow-wrap: anywhere;
}

.tm-knowledge-drawer__close {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--drawer-edge);
  border-radius: 50%;
  background: var(--drawer-sheen), var(--surface-2);
  color: var(--ink);
  font: 400 1.43rem/1 var(--sans);
}

.tm-knowledge-drawer__close:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.tm-knowledge-drawer__close svg {
  width: 1.02rem;
  height: 1.02rem;
}

.tm-knowledge-drawer__back-label {
  display: none;
}

.tm-knowledge-drawer__navigation {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.55rem;
  padding: 0.18rem;
  border: 1px solid var(--drawer-edge);
  border-radius: var(--r-pill);
  background: var(--drawer-sheen), var(--surface-2);
}

.tm-knowledge-drawer [data-knowledge-drawer-step] {
  display: flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  gap: 0.42rem;
  padding: 0 0.65rem;
  border: 1px solid var(--drawer-edge);
  border-radius: var(--r-pill);
  color: var(--ink);
  font-size: 1.1rem;
}

.tm-knowledge-drawer [data-knowledge-drawer-step] svg {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
}

.tm-knowledge-drawer [data-knowledge-drawer-step]:last-child {
  justify-content: flex-end;
}

.tm-knowledge-drawer [data-knowledge-drawer-step]:last-child svg {
  order: 1;
}

.tm-knowledge-drawer__step-title {
  min-width: 0;
  overflow: hidden;
  font: 600 0.73rem/1.35 var(--sans);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tm-knowledge-drawer__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.tm-knowledge-drawer [data-knowledge-drawer-step]:not([aria-disabled="true"]):hover {
  border-color: var(--gold);
  background: var(--gold-glow);
  color: var(--gold);
}

.tm-knowledge-drawer [data-knowledge-drawer-step][aria-disabled="true"] {
  color: var(--muted);
  opacity: 0.55;
  cursor: default;
}

.tm-knowledge-drawer__position {
  min-width: 0;
  margin: 0;
  color: var(--ink-2);
  font: 600 0.76rem/1.35 var(--sans);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.tm-knowledge-drawer__body {
  min-width: 0;
  min-height: 0;
  padding: var(--drawer-inset);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.tm-knowledge-drawer :is(button, a, summary, input, select, [tabindex]):focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.tm-knowledge-drawer__body:focus-visible {
  outline-offset: -3px;
}

.tm-knowledge-drawer :is(.tm-atlas-inline-detail, .tm-tech-inline-detail) {
  min-width: 0;
  gap: 1rem;
  margin: 0;
  padding: 0;
  border: 0;
  overflow-wrap: anywhere;
  animation: none;
}

.tm-knowledge-drawer .tm-tech-rows {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.tm-knowledge-drawer .tm-tech-row {
  min-width: 0;
  padding: 0.7rem;
  border: 1px solid var(--drawer-edge);
  border-radius: var(--r-sm);
  background: var(--iris-module-card, var(--surface-2));
}

.tm-knowledge-drawer .tm-tech-row span {
  color: var(--muted);
  font-size: 0.65rem;
}

.tm-knowledge-drawer .tm-tech-row strong,
.tm-knowledge-drawer .tm-knowledge-v2__details dd {
  color: var(--ink);
  font-size: 0.88rem;
}

.tm-knowledge-drawer :is(.tm-tech-muted, .tm-knowledge-v2__summary, .tm-knowledge-v2__sections p, .tm-knowledge-v2__claims, .tm-knowledge-v2__sources) {
  color: var(--ink-2);
  font-size: 0.9rem;
  line-height: 1.62;
}

.tm-knowledge-drawer :is(.tm-tech-badges, .tm-feed-meta) span {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.tm-knowledge-drawer .tm-knowledge-bridge {
  border-color: var(--drawer-edge);
  background: var(--drawer-sheen), var(--iris-module-card, var(--surface-2));
}

.tm-knowledge-drawer .tm-knowledge-bridge__link {
  border-color: var(--drawer-edge);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
}

.tm-knowledge-drawer .tm-knowledge-bridge__link small {
  grid-column: 2;
  min-width: 0;
  overflow-wrap: anywhere;
}

.tm-knowledge-drawer .tm-library-carnet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding-block: 0.9rem 0.15rem;
  border-top: 1px solid var(--drawer-edge);
}

.tm-knowledge-drawer .tm-library-carnet-actions > :is(.tm-feed-btn, .tm-workspace-carnet-save-btn) {
  display: inline-flex;
  flex: 1 1 auto;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--drawer-edge);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--ink);
  font: 600 0.78rem/1.3 var(--sans);
  text-align: center;
}

.tm-knowledge-drawer .tm-library-carnet-actions > .tm-workspace-carnet-save-btn {
  flex-basis: 100%;
  border-color: color-mix(in srgb, var(--gold) 48%, transparent);
  background: var(--gold-glow);
  color: var(--gold);
}

.tm-knowledge-drawer .tm-library-carnet-actions > :is(.tm-feed-btn, .tm-workspace-carnet-save-btn):hover {
  border-color: var(--gold);
  color: var(--gold);
}

.tm-knowledge-drawer .tm-knowledge-entry {
  gap: clamp(0.85rem, 1.9vw, 1.3rem);
}

.tm-knowledge-drawer .tm-knowledge-entry__primary {
  margin: 0;
  padding: 0;
  border: 0;
}

.tm-knowledge-entry__intro {
  margin: 0;
  padding: clamp(0.8rem, 1.8vw, 1.25rem);
  border-block-start: 1px solid var(--drawer-edge);
  border-inline-start: 2px solid var(--gold);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: var(--drawer-sheen), var(--iris-module-card, var(--surface));
  color: var(--ink);
  font: 500 clamp(1.02rem, 1.5vw, 1.17rem)/1.52 var(--sans);
  text-wrap: pretty;
}

.tm-knowledge-entry__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
  gap: 0.52rem;
  margin: 0;
}

.tm-knowledge-entry__facts > div {
  min-width: 0;
  padding: 0.62rem 0.72rem;
  border: 1px solid var(--drawer-edge);
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--ink) 4%, transparent);
}

.tm-knowledge-entry__facts dt {
  margin-bottom: 0.24rem;
  color: var(--ink-2);
  font: 550 0.65rem/1.35 var(--sans);
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.tm-knowledge-entry__facts dd {
  margin: 0;
  color: var(--ink);
  font: 500 0.88rem/1.38 var(--sans);
}

.tm-knowledge-entry__visual {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--drawer-edge);
  border-radius: var(--r-md);
  background: var(--surface-2);
}

.tm-knowledge-entry__visual .tm-knowledge-entry__photo {
  display: block;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: var(--surface);
}

.tm-knowledge-entry__visual .tm-knowledge-entry__photo::after {
  display: none;
}

.tm-knowledge-entry__visual .tm-knowledge-entry__photo img {
  width: 100%;
  height: auto;
  max-height: clamp(13rem, 37vh, 22rem);
  object-fit: contain;
  filter: none;
  transform: none;
}

.tm-knowledge-entry__visual .tm-knowledge-entry__photo:is(.is-pending, .is-unavailable) {
  display: grid;
  place-items: center;
  min-height: 5rem;
}

.tm-knowledge-entry__visual .tm-knowledge-entry__photo:is(.is-pending, .is-unavailable) img {
  position: absolute;
}

.tm-knowledge-entry__diagram {
  position: relative;
  min-height: 8.75rem;
  max-height: 16rem;
  aspect-ratio: 2.5;
  overflow: hidden;
  background: var(--drawer-sheen), var(--surface);
  color: color-mix(in srgb, var(--ink) 68%, transparent);
}

.tm-knowledge-entry__diagram-frame {
  position: absolute;
  inset: 15% 12% 19%;
  border-block: 2px solid currentColor;
  background:
    linear-gradient(currentColor, currentColor) 12% 0 / 2px 100%,
    linear-gradient(currentColor, currentColor) 49% 0 / 2px 100%,
    linear-gradient(currentColor, currentColor) 88% 0 / 2px 100%,
    linear-gradient(currentColor, currentColor) 50% 47% / 100% 2px;
  background-repeat: no-repeat;
}

.tm-knowledge-entry__diagram-ramp {
  position: absolute;
  inset: 15% 19% 19%;
  background: var(--gold);
  clip-path: polygon(53% 0, 55% 0, 87% 47%, 58% 47%, 26% 100%, 24% 100%, 57% 44%, 84% 44%);
}

.tm-knowledge-entry__visual figcaption {
  display: grid;
  gap: 0.24rem;
  padding: 0.63rem 0.78rem;
  color: var(--ink-2);
  font: 500 0.83rem/1.4 var(--sans);
}

.tm-knowledge-entry__visual figcaption small {
  font-size: 0.73rem;
}

.tm-knowledge-entry :is(figcaption, .tm-knowledge-entry__sources) a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.tm-knowledge-entry__toc {
  padding: 0.7rem 0.83rem;
  border: 1px solid var(--drawer-edge);
  border-radius: var(--r-md);
  background: var(--drawer-sheen), var(--surface);
}

.tm-knowledge-entry__toc h3 {
  margin: 0 0 0.32rem;
  color: var(--ink-2);
  font: 600 0.7rem/1.35 var(--sans);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.tm-knowledge-entry__toc ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tm-knowledge-entry__toc button {
  min-height: 38px;
  padding: 0.4rem 0.62rem;
  border: 1px solid var(--drawer-edge);
  border-radius: var(--r-pill);
  color: var(--ink);
  font: 500 0.78rem/1.25 var(--sans);
  text-align: start;
}

.tm-knowledge-entry__toc button:hover {
  border-color: var(--gold);
  background: var(--gold-glow);
}

.tm-knowledge-entry__section {
  display: grid;
  gap: 0.42rem;
  min-width: 0;
  padding-block-start: 0.8rem;
  border-block-start: 1px solid var(--drawer-edge);
  scroll-margin-block-start: 0.8rem;
}

.tm-knowledge-entry__section h3 {
  margin: 0;
  color: var(--ink);
  font: 600 clamp(1.38rem, 2.3vw, 1.92rem)/1.06 var(--serif);
  letter-spacing: -0.02em;
}

.tm-knowledge-entry__section :is(p, ul) {
  margin: 0;
  color: var(--ink-2);
  font: 450 0.92rem/1.65 var(--sans);
  text-wrap: pretty;
}

.tm-knowledge-entry__sources ul {
  display: grid;
  gap: 0.38rem;
  padding-inline-start: 1.1rem;
}

.tm-knowledge-drawer .tm-knowledge-entry .tm-knowledge-bridge__links {
  gap: 0.52rem;
}

.tm-knowledge-drawer .tm-knowledge-entry .tm-knowledge-bridge__link {
  grid-template-columns: minmax(0, 1fr);
  gap: 0.25rem;
  padding: 0.68rem 0.75rem;
}

.tm-knowledge-drawer .tm-knowledge-entry .tm-knowledge-bridge__link small {
  grid-column: auto;
  color: var(--ink-2);
  font-size: 0.78rem;
  line-height: 1.45;
}

.tm-knowledge-drawer .tm-knowledge-entry .tm-knowledge-bridge__link strong {
  font-size: 0.93rem;
}

.tm-knowledge-drawer__panel > .tm-reference-capture {
  position: absolute;
  z-index: 3;
  grid-template-rows: minmax(0, 1fr);
}

.tm-knowledge-drawer__panel > .tm-reference-capture .tm-reference-capture__panel {
  max-height: 100%;
  overscroll-behavior: contain;
  border-radius: var(--r-md);
}

[data-theme="light"] .tm-knowledge-drawer__panel > .tm-reference-capture footer > button.is-primary {
  color: var(--surface);
}

.tm-knowledge-drawer__transition {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: none;
  place-items: center;
  border-radius: inherit;
  background: var(--drawer-sheen), var(--drawer-fill);
  pointer-events: none;
}

.tm-knowledge-drawer.is-opening .tm-knowledge-drawer__transition {
  display: grid;
  animation: tm-knowledge-drawer-veil 550ms var(--ease-interface, ease-out) both;
}

.tm-knowledge-drawer.is-opening .tm-iris-emblem {
  width: 4.35rem;
  height: 4.35rem;
  animation: none;
}

.tm-knowledge-drawer.is-opening .tm-iris-emblem path {
  --drawer-trace-start: calc(var(--iris-trace-delay, 0ms) * 0.35);
  stroke: var(--gold);
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation:
    tm-knowledge-drawer-trace 120ms var(--ease-interface, ease-out) var(--drawer-trace-start) both,
    tm-knowledge-drawer-trace 105ms ease-in calc(407ms - var(--drawer-trace-start)) reverse forwards;
}

.tm-knowledge-drawer.is-opening .tm-iris-emblem circle {
  fill: var(--gold);
  animation: tm-knowledge-drawer-emblem-dot 490ms ease both;
}

@keyframes tm-knowledge-drawer-veil {
  0% { opacity: 0.85; }
  18%, 76% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes tm-knowledge-drawer-trace {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

@keyframes tm-knowledge-drawer-emblem-dot {
  0%, 35%, 62%, 100% { opacity: 0; }
  44%, 54% { opacity: 1; }
}

:is(#module-atlas, #module-chronos, #module-pantheon) :is(.tm-atlas-world-card, .tm-tech-card).is-reading {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px var(--gold-dim);
  opacity: 1;
}

:is(#module-atlas, #module-chronos, #module-pantheon) :is(.tm-atlas-world-card, .tm-tech-card).is-reading[data-reading-label]::after {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 1;
  padding: 0.28rem 0.52rem;
  border: 1px solid color-mix(in srgb, var(--gold) 44%, var(--surface));
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--gold);
  box-shadow: 0 2px 8px rgba(5, 5, 5, 0.25);
  content: attr(data-reading-label);
  font: 650 0.67rem/1.25 var(--sans);
  pointer-events: none;
}

.tm-knowledge-compact,
[data-knowledge-compact-host]:empty {
  display: none;
}

:is(#module-atlas, #module-chronos, #module-pantheon) .tm-tech-controls:has(.tm-knowledge-filter-toggle) {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

:is(#module-atlas, #module-chronos, #module-pantheon) .tm-tech-controls:has(.tm-knowledge-filter-toggle) .tm-tech-search {
  grid-column: auto;
}

.tm-tech-controls .tm-knowledge-filter-toggle {
  display: inline-flex;
  width: auto;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.32rem 0.65rem;
  border: 1px solid var(--catalog-edge);
  border-radius: 0.67rem;
  background: var(--catalog-control-fill);
  color: var(--ink);
  font: 600 0.76rem/1.2 var(--sans);
}

.tm-knowledge-filter-toggle:is(:hover, [aria-expanded="true"]) {
  border-color: var(--gold);
  color: var(--gold);
}

.tm-knowledge-filter-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

.tm-knowledge-filter-toggle__count {
  min-width: 1.15rem;
  padding: 0.15rem;
  border-radius: var(--r-pill);
  background: var(--gold-dim);
  color: var(--gold);
  text-align: center;
}

.tm-tech-controls .tm-knowledge-filters {
  display: none;
}

.tm-knowledge-filter-toggle:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.tm-tech-controls .tm-knowledge-filter-toggle[aria-expanded="true"] + .tm-knowledge-filters {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr));
  gap: 0.4rem;
  min-width: 0;
  padding-block: 0.18rem;
}

.tm-tech-controls .tm-knowledge-filters :is(.tm-tech-filter-group, select) {
  min-width: 0;
  text-overflow: ellipsis;
}

@media (max-width: 899px) {
  .tm-tech-controls .tm-tech-search input:placeholder-shown {
    text-overflow: ellipsis;
  }

  .tm-tech-controls .tm-knowledge-filter-toggle {
    min-height: 44px;
    padding-inline: 0.6rem;
  }

  .tm-tech-controls .tm-knowledge-filter-toggle svg {
    flex: none;
  }
}

/* The right column is part of the desktop layout while its drawer is open. */
@media (min-width: 900px) {
  html.has-knowledge-drawer-docked {
    --knowledge-rail-gap: clamp(0.6rem, 1vw, 0.95rem);
    --knowledge-rail-radius: clamp(18px, 2vw, 28px);
  }

  html.has-knowledge-drawer-docked,
  html.has-knowledge-drawer-docked body {
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
  }

  html.has-knowledge-drawer-docked .app-body {
    min-height: 0;
    height: 100%;
  }

  html.has-knowledge-drawer-docked .main-wrap {
    min-height: 0;
    margin-inline-end: var(--knowledge-dock-width);
  }

  html.has-knowledge-drawer-docked .site-footer { display: none; }

  html.has-knowledge-drawer-docked #main-app.app {
    grid-template-rows: minmax(0, 1fr);
    min-height: 0;
    padding: var(--knowledge-rail-gap);
  }

  html.has-knowledge-drawer-docked body.tm-sidebar-collapsed #main-app,
  html.has-knowledge-drawer-docked body.tm-immersive #main-app {
    padding-inline-start: 3.25rem;
  }

  html.has-knowledge-drawer-docked #view {
    grid-template-rows: minmax(0, 1fr);
    min-height: 0;
  }

  html.has-knowledge-drawer-docked :is(#module-atlas, #module-chronos, #module-pantheon).is-active {
    grid-template-rows: auto minmax(0, 1fr);
    gap: 0;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    border-radius: var(--knowledge-rail-radius);
    background: var(--iris-reading-highlight, var(--catalog-highlight)), var(--iris-module-glass);
    -webkit-backdrop-filter: blur(26px);
    backdrop-filter: blur(26px);
  }

  html.has-knowledge-drawer-docked :is(#atlas-grid, #chronos-layout, #pantheon-grid) {
    display: grid;
    grid-template: minmax(0, 1fr) / minmax(0, 1fr);
    min-height: 0;
  }

  html.has-knowledge-drawer-docked :is(#module-atlas, #module-chronos, #module-pantheon) > .section-head {
    display: block;
    margin: 0;
    padding: 0.72rem clamp(0.65rem, 1.4vw, 1.2rem) 0.57rem;
    border: 0;
    border-bottom: 1px solid var(--catalog-edge);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  html.has-knowledge-drawer-docked :is(#module-atlas, #module-chronos, #module-pantheon) .section-head__kicker {
    margin: 0 0 0.1rem;
  }

  html.has-knowledge-drawer-docked :is(#module-atlas, #module-chronos, #module-pantheon) .section-head__title {
    font: 550 clamp(1.42rem, 2.4vw, 2.36rem)/1 var(--serif);
    letter-spacing: -0.035em;
  }

  html.has-knowledge-drawer-docked :is(#module-atlas, #module-chronos, #module-pantheon) .section-head__desc {
    display: none;
  }

  html.has-knowledge-drawer-docked [data-knowledge-catalogue] {
    display: block;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scroll-padding-block-start: 4rem;
    overflow-anchor: none;
  }

  html.has-knowledge-drawer-docked [data-knowledge-catalogue]:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: -2px;
  }

  .tm-knowledge-drawer[data-docked] {
    --drawer-inset: clamp(0.8rem, 1.55vw, 1.45rem);
    --drawer-edge-gap: var(--knowledge-rail-gap);
    --drawer-top: calc(var(--topbar-h, 68px) + var(--knowledge-rail-gap));
    --drawer-sheen: var(--iris-reading-highlight, var(--iris-module-highlight));
    z-index: 20;
    width: calc(var(--knowledge-dock-width) - var(--knowledge-rail-gap));
    border-radius: var(--knowledge-rail-radius);
  }

  body.tm-immersive .tm-knowledge-drawer[data-docked] {
    --drawer-top: var(--knowledge-rail-gap);
  }

  .tm-knowledge-drawer[data-docked] .tm-knowledge-drawer__header {
    row-gap: 0.55rem;
    background: transparent;
  }

  .tm-knowledge-drawer[data-docked] .tm-knowledge-drawer__header h2 {
    font: 550 clamp(1.6rem, 2.6vw, 2.75rem)/1.02 var(--serif);
    letter-spacing: -0.025em;
  }

  .tm-knowledge-drawer[data-docked] .tm-knowledge-drawer__navigation {
    gap: 0.42rem;
    padding: 0;
    border: 0;
    background: none;
  }

  .tm-knowledge-drawer[data-docked] [data-knowledge-drawer-step] {
    min-height: 44px;
    border-radius: 0.75rem;
    background: color-mix(in srgb, var(--ink) 4%, transparent);
  }

  .tm-knowledge-drawer[data-docked] .tm-tech-row {
    padding: 0.63rem 0.75rem;
    border-radius: 0.75rem;
    background: color-mix(in srgb, var(--ink) 4%, transparent);
  }

  .tm-knowledge-drawer[data-docked] .tm-tech-row span {
    color: var(--ink-2);
    letter-spacing: 0.095em;
  }

  .tm-knowledge-drawer[data-docked] .tm-tech-row strong {
    font-weight: 500;
    line-height: 1.45;
  }

  html.has-knowledge-drawer-docked :is(#module-atlas, #module-chronos, #module-pantheon) .tm-tech-controls {
    position: sticky;
    top: 0;
    z-index: 3;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.4rem;
    padding: 0.48rem clamp(0.65rem, 1.4vw, 1.2rem);
    border: 0;
    border-bottom: 1px solid var(--catalog-edge);
    border-radius: 0;
    background: color-mix(in srgb, var(--surface) 91%, transparent);
  }

  html.has-knowledge-drawer-docked .tm-tech-controls:has([data-knowledge-filter-toggle][aria-expanded="true"]) {
    position: static;
  }

  html.has-knowledge-drawer-docked :is(#module-atlas, #module-chronos, #module-pantheon) .tm-tech-controls .field {
    min-height: 38px;
    gap: 0.12rem;
    padding: 0.32rem 0.55rem;
    border-radius: 0.67rem;
  }

  html.has-knowledge-drawer-docked :is(#module-atlas, #module-chronos, #module-pantheon) .tm-tech-controls .tm-tech-search {
    grid-column: auto;
  }

  html.has-knowledge-drawer-docked #module-chronos .tm-tech-compare {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.35rem;
    margin: 0.6rem 0.7rem 0;
  }

  html.has-knowledge-drawer-docked #module-chronos .tm-tech-compare-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  html.has-knowledge-drawer-docked #module-chronos .tm-tech-compare:not(.has-selection),
  html.has-knowledge-drawer-docked :is(#module-atlas, #module-chronos, #module-pantheon) :is(
    .tm-atlas-world-grid, .tm-tech-layout, .tm-focus-rail-head, .tm-atlas-results-summary, .tm-atlas-catalog-footer
  ) {
    display: none;
  }

  html.has-knowledge-drawer-docked .tm-knowledge-compact {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
    padding: clamp(0.62rem, 1.25vw, 0.95rem);
  }

  .tm-knowledge-compact__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.15rem 0.42rem 0.4rem;
  }

  .tm-knowledge-compact__head h3 {
    margin: 0;
    color: var(--ink);
    font: 650 1.05rem/1.15 var(--display-font, var(--sans));
    letter-spacing: -0.035em;
  }

  .tm-knowledge-compact__head > span {
    color: var(--ink-2);
    font: 550 0.72rem/1.3 var(--sans);
    font-variant-numeric: tabular-nums;
    text-align: end;
  }

  .tm-knowledge-compact__list {
    display: grid;
    gap: 0.28rem;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .tm-knowledge-compact__list > li {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    min-width: 0;
    border: 1px solid transparent;
    border-bottom-color: var(--catalog-edge);
    border-radius: 0.65rem;
    background: color-mix(in srgb, var(--ink) 3%, transparent);
  }

  .tm-knowledge-compact__list > li:has([data-chronos-compare]) {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.35rem;
    padding-inline-end: 0.35rem;
  }

  .tm-knowledge-compact__list > li:has([aria-current="true"]) {
    border-color: color-mix(in srgb, var(--gold) 60%, var(--catalog-edge));
    background: color-mix(in srgb, var(--gold) 9%, var(--surface));
  }

  .tm-knowledge-compact__item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    min-height: 46px;
    padding: 0.36rem 0.55rem;
    border-radius: inherit;
    color: var(--ink);
    text-align: start;
  }

  .tm-knowledge-compact__item:hover {
    background: var(--gold-glow);
  }

  .tm-knowledge-compact :is(ul, button, a):focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: -2px;
  }

  .tm-knowledge-compact__copy {
    display: grid;
    min-width: 0;
    gap: 0.14rem;
    overflow-wrap: anywhere;
  }

  .tm-knowledge-compact__copy strong {
    font: 625 0.88rem/1.25 var(--sans);
    letter-spacing: -0.012em;
  }

  .tm-knowledge-compact__copy small {
    color: var(--ink-2);
    font: 450 0.72rem/1.35 var(--sans);
  }

  .tm-knowledge-compact__marker {
    min-width: 0.75rem;
    color: var(--gold);
    font-size: 0.76rem;
    text-align: center;
  }

  .tm-knowledge-compact__list > li > [data-chronos-compare] {
    display: grid;
    width: 38px;
    height: 38px;
    padding: 0;
    place-items: center;
    border: 1px solid var(--catalog-edge);
    border-radius: 50%;
    color: var(--ink-2);
  }

  .tm-knowledge-compact__list > li > [data-chronos-compare]:is(:hover, [aria-pressed="true"]) {
    border-color: color-mix(in srgb, var(--gold) 60%, var(--catalog-edge));
    background: var(--gold-dim);
    color: var(--gold);
  }

  .tm-knowledge-compact__empty {
    padding-inline: 0.42rem;
    color: var(--ink-2);
    font-size: 0.85rem;
  }

  .tm-knowledge-compact__footer:not(:empty) {
    padding: 0.38rem 0.22rem 0.08rem;
  }

  .tm-knowledge-compact__footer .tm-student-paywall {
    width: 100%;
    min-width: 0;
  }

  .tm-knowledge-compact__footer .tm-student-paywall__top {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (min-width: 900px) and (max-width: 1199px) {
  .tm-knowledge-drawer[data-docked] .tm-tech-rows,
  .tm-knowledge-drawer[data-docked] .tm-knowledge-v2__details dl > div {
    grid-template-columns: minmax(0, 1fr);
  }

  html.has-knowledge-drawer-docked :is(#module-chronos, #module-pantheon) .tm-tech-controls .tm-tech-chip-row .tm-tech-chip {
    min-height: 27px;
    padding: 0.22rem 0.52rem;
    font-size: 0.69rem;
  }
}

@media (max-width: 899px) {
  .tm-knowledge-drawer {
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
  }

  .tm-knowledge-drawer__header {
    padding-top: max(var(--drawer-inset), env(safe-area-inset-top));
    row-gap: 0.7rem;
  }

  .tm-knowledge-drawer__header h2 {
    font: 550 clamp(1.75rem, 6vw, 2.65rem)/1.03 var(--serif);
    letter-spacing: -0.025em;
  }

  .tm-knowledge-drawer__close:has(.tm-knowledge-drawer__back-label) {
    display: inline-flex;
    width: auto;
    gap: 0.42rem;
    align-items: center;
    justify-content: center;
    padding-inline: 0.65rem;
    border-radius: var(--r-pill);
  }

  .tm-knowledge-drawer__back-label {
    display: inline;
    font: 600 0.7rem/1 var(--sans);
  }

  .tm-knowledge-drawer__body {
    padding-bottom: max(var(--drawer-inset), env(safe-area-inset-bottom));
  }

  .tm-knowledge-drawer .tm-knowledge-entry__primary {
    position: sticky;
    inset-block-start: 0;
    z-index: 1;
    margin: calc(-1 * var(--drawer-inset)) calc(-1 * var(--drawer-inset)) 0;
    padding: 0.55rem var(--drawer-inset);
    border-block-end: 1px solid var(--drawer-edge);
    background: var(--surface);
    background: var(--drawer-sheen), var(--drawer-fill);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }

  .tm-knowledge-entry__section {
    scroll-margin-block-start: 4.35rem;
  }

  .tm-knowledge-entry__toc button {
    min-height: 44px;
  }
}

@media (max-width: 430px) {
  .tm-knowledge-drawer .tm-tech-rows {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tm-knowledge-drawer.is-opening .tm-knowledge-drawer__transition {
    display: none;
    animation: none;
  }
}

html.has-knowledge-drawer:not(.has-knowledge-drawer-docked) {
  overflow-y: hidden;
}

html.has-knowledge-drawer-gutter {
  scrollbar-gutter: stable;
}

.tm-knowledge-drawer [data-knowledge-share-status]:empty {
  display: none;
}

.tm-knowledge-drawer #tm-knowledge-toast-wrap {
  position: absolute;
  inset: auto var(--drawer-inset) var(--drawer-inset) auto;
  z-index: 4;
}

.tm-knowledge-drawer .tm-feed-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tm-knowledge-drawer .tm-feed-meta span {
  padding: 0.26rem 0.6rem;
  border: 1px solid var(--drawer-edge);
  border-radius: var(--r-pill);
  color: var(--ink-2);
  font-size: 0.76rem;
}

/* The catalogue keeps its document position when the reading column changes width. */
.app-body:has(.is-active:is(#module-atlas, #module-chronos, #module-pantheon)) {
  overflow-anchor: none;
}

@media (min-width: 900px) and (max-width: 1199px) {
  html.has-knowledge-drawer-docked body:not(.tm-immersive) {
    --sidebar-w: 190px;
  }

  html.has-knowledge-drawer-docked .sidebar-item {
    padding-inline: 0.58rem;
  }
}
