/* D-171, D-173 and D-205, scoped to the three public works. */
/* The module help follows the title on the brand line. */
body[data-public-work-chrome] main.ritual-room > header.public-module-header {
  grid-template-columns: minmax(0, 1fr) var(--account-width);
}
body[data-public-work-chrome] main.ritual-room > header.public-module-header.has-work-access {
  grid-template-columns: minmax(0, 1fr) var(--account-height) var(--account-width);
}
/* Keep help above the work tools and the local preview controls (z-index 41). */
body[data-public-work-chrome] main.ritual-room > header.public-module-header:has(.public-module-help-panel:not([hidden])) {
  z-index: 42;
}
body[data-public-work-chrome] main.ritual-room.has-module-navigation > header.pluritual-header.public-module-header > .account-button {
  grid-column: -2;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-direction: row;
}
body[data-public-work-chrome] main.ritual-room > header.public-module-header > .live-site-utilities {
  grid-column: -3;
}
body[data-public-work-chrome] .public-module-header .public-module-help {
  --help-target-size: 44px;
  --help-circle-size: 24px;
  position: relative;
  align-self: start;
  flex: 0 0 auto;
  margin: calc(var(--header-separator-top) + (var(--header-separator-height) - var(--help-target-size)) / 2) 0 0 -8px;
  color: inherit;
  pointer-events: auto;
}
body[data-public-work-chrome] main.ritual-room > header.public-module-header .public-module-help > .module-how-trigger {
  position: relative;
  width: var(--help-target-size);
  height: var(--help-target-size);
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  box-shadow: none;
  backdrop-filter: none;
}
body[data-public-work-chrome] main.ritual-room > header.public-module-header .public-module-help > .module-how-trigger::before {
  content: "";
  position: absolute;
  inset: 0;
  width: var(--help-circle-size);
  height: var(--help-circle-size);
  box-sizing: border-box;
  margin: auto;
  border: 1px solid color-mix(in srgb, currentColor 38%, transparent);
  border-radius: 50%;
  pointer-events: none;
}
body[data-public-work-chrome] main.ritual-room > header.public-module-header .public-module-help > .module-how-trigger:is(:hover, [aria-expanded="true"])::before {
  border-color: currentColor;
  background: color-mix(in srgb, currentColor 9%, transparent);
}
body[data-public-work-chrome] main.ritual-room > header.public-module-header .public-module-help > .module-how-trigger > svg.help-question-icon {
  position: relative;
  width: 14px;
  height: 14px;
}
body[data-public-work-chrome] main.ritual-room > header.public-module-header .public-module-help.is-title-typing > .module-how-trigger {
  visibility: hidden;
}
body[data-public-work-chrome] .public-module-help-panel {
  --help-fill: var(--public-help-surface, #172125);
  --help-edge: color-mix(in srgb, currentColor 28%, var(--help-fill));
  position: absolute;
  z-index: 2;
  top: 100%;
  box-sizing: border-box;
  width: min(17rem, calc(100vw - 24px));
  border: 1px solid var(--help-edge);
  border-radius: 12px;
  background: var(--help-fill);
  box-shadow: 0 5px 16px #0003;
  font: 400 .875rem/1.45 var(--pluritual-sans, Arial, sans-serif);
  letter-spacing: normal;
  white-space: normal;
  text-align: center;
  user-select: text;
}
body[data-public-work-chrome] .public-module-help-panel[hidden] { display: none; }
body[data-public-work-chrome] .public-module-help-panel::before {
  content: "";
  position: absolute;
  top: -1px;
  left: calc(var(--help-tip-x, 50%) - 1px);
  width: 9px;
  height: 9px;
  box-sizing: border-box;
  transform: translate(-50%, -50%) rotate(45deg);
  border-top: 1px solid var(--help-edge);
  border-left: 1px solid var(--help-edge);
  background: var(--help-fill);
}
body[data-public-work-chrome] .public-module-help-content {
  display: grid;
  gap: .4rem;
  max-height: calc(100dvh - 75px);
  overflow-y: auto;
  padding: .85rem 1rem;
  box-sizing: border-box;
}
body[data-public-work-chrome] .public-module-help-content > strong {
  font: 400 1.125rem/1.15 var(--pluritual-serif, Georgia, serif);
}
body[data-public-work-chrome] main.ritual-room.canvas { --public-help-surface: #f8efe0; }
body[data-public-work-chrome] main.ritual-room.clock { --public-help-surface: #101c25; }

/* Keep the countdown in the same place below the touch, using the module numerals. */
body[data-public-work-chrome] main.landing.imprint-landing.gravity-landing .imprint-entry > .imprint-next-reveal {
  margin-top: 17px;
  color: #211f1a;
  opacity: 1;
}
body[data-public-work-chrome] main.landing.imprint-landing.gravity-landing .imprint-entry > .imprint-next-reveal strong {
  font-size: 28px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
body[data-public-work-chrome] main.landing.imprint-landing.gravity-landing .landing-wordmark {
  width: 184px;
}
@media (max-width: 900px), (max-width: 1024px) and (max-height: 500px) {
  body[data-public-work-chrome] main.landing.imprint-landing.gravity-landing .imprint-entry > .imprint-next-reveal strong {
    font-size: 26px;
  }
}
@media (max-width: 600px) and (max-height: 700px), (max-height: 500px) {
  body[data-public-work-chrome] main.landing.imprint-landing.gravity-landing .landing-wordmark {
    width: 120px;
  }
}
@media (max-width: 600px) and (max-height: 450px) {
  body[data-public-work-chrome] main.landing.imprint-landing.gravity-landing {
    --contact-size: 88px;
  }
  body[data-public-work-chrome] main.landing.imprint-landing.gravity-landing .imprint-entry > .imprint-next-reveal {
    margin-top: 2px;
    top: calc(50dvh + var(--contact-size) / 2);
  }
  body[data-public-work-chrome] .landing-footer .site-legal-links {
    column-gap: 6px;
  }
}
@media (min-width: 601px) and (max-height: 500px) {
  body[data-public-work-chrome] main.landing.imprint-landing.gravity-landing .imprint-entry > .imprint-next-reveal {
    margin-top: 9px;
  }
}

/* The compact facts footer has three rows and may wrap its Humanity credit.
   Reserve its intrinsic height so each work can shrink before its controls
   reach the footer. The existing Chapter keyboard layout keeps its own rows. */
@media (max-width: 650px) {
  body[data-public-work-chrome] main.ritual-room:is(.canvas, .clock, .sentence).has-annual-stats.has-work-facts.has-module-navigation:has(.wip-explore-nav) {
    grid-template-rows: var(--module-header-height, 96px) minmax(0, 1fr) max-content;
  }
}
