/* Live fields occupy the existing approved index paper; no extra panel artwork. */
body.ff-fullroom-archive .ffa-filter-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 6px;
  margin: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  font-size: clamp(16px, 2.1cqw, 20px);
  line-height: 1.3;
}
body.ff-fullroom-archive .ffa-filter-controls label {
  display: grid;
  gap: 2px;
  margin: 0;
  color: inherit;
}
body.ff-fullroom-archive .ffa-filter-controls :is(select,button) {
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  font: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #9a784e;
  border-radius: 0;
  box-shadow: none;
  padding: 5px 3px;
}
body.ff-fullroom-archive .ffa-filter-controls button {
  width: auto;
  align-self: flex-start;
  cursor: pointer;
  text-decoration: underline;
  padding: 7px;
}
/* Native GET search remains reachable without scripting even without a hash. */
body.ff-fullroom-archive.ff-archive-query .ffa-catalog {
  visibility: visible;
  pointer-events: auto;
}
body.ff-fullroom-archive.ff-archive-query [data-archive-ready="true"] .ffa-catalog {
  visibility: hidden;
  pointer-events: none;
}
body.ff-fullroom-archive .ff-archive-password {
  width: min(100%, 34rem);
  margin: auto;
  padding: 1.5rem;
  background: #f4ebd9;
  color: #382a1b;
  overflow: auto;
  max-height: 100dvh;
}
body.ff-fullroom-archive .ff-archive-main > .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
/* Keep the primary action visible in the existing paper footer on phones. */
body.ff-fullroom-archive .ffa-filter-submit {
  max-height: none;
  min-height: 44px;
  font-size: clamp(16px, 2.1cqw, 20px);
}
body.ff-fullroom-archive .ffa-filter-submit button {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 5px;
  font: inherit;
  color: #382a1b;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}
/* Preserve the existing approved map control without a conventional header.
   Desktop docks over the room; mobile gives it its own readable flow space. */
body.ff-fullroom-archive .ff-archive-directory .ffx-roadmap.ffx-docked {
  left: auto;
  right: 16px;
  top: calc(12px + env(safe-area-inset-top));
  width: 300px;
}
@media (max-width: 800px) {
  body.ff-fullroom-archive .ff-archive-directory {
    position: relative;
    z-index: 5;
    width: min(340px, calc(100% - 24px));
    margin: 12px auto;
  }
  body.ff-fullroom-archive .ff-archive-directory .ffx-roadmap.ffx-docked {
    position: relative;
    inset: auto;
    width: 100%;
    max-width: none;
  }
}
/* The no-script index lives inside the isolated room stacking context.
   Raise that context only while the fallback is open, so the retained map
   control cannot cover its Close link. Enhanced readers use the top layer. */
body.ff-fullroom-archive.ff-archive-query:not(:has([data-archive-ready="true"])) .ff-archive-main,
body.ff-fullroom-archive:has(.ffa-catalog:target):not(:has([data-archive-ready="true"])) .ff-archive-main {
  z-index: 200;
}
