/* Visitor surface only: no artwork transforms, semantic coordinates, or hit layers. */
main {
  padding: 20px 28px 18px;
}

.searchBar { gap: 8px; }
#searchForm { box-shadow: inset 0 2px 12px #fff, 0 5px 24px #83749908; }
#query { font-size: 17px; }
#undo { min-width: 44px; }
#newSearch { min-height: 44px; }

.queryOptions {
  min-height: 44px;
  margin-top: 2px;
  padding: 0 13px;
  gap: 8px 16px;
  flex-wrap: wrap;
}
.queryOptions label { min-height: 44px; line-height: 1.4; }
.zoomControls { flex-shrink: 0; }
.zoomControls button { min-width: 44px; min-height: 44px; }
.zoomControls #zoomReset { min-width: 48px; }

.muz3Bar {
  min-height: 30px;
  margin-top: 1px;
  gap: 4px 20px;
  color: #786e80;
}
.muz3Identity {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 13px;
  letter-spacing: .19em;
  color: #55465f;
  font-size: 12px;
  line-height: 1.5;
}
.muz3Identity small {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .01em;
  color: #817685;
}
.muz3Bar #layoutNotice {
  max-width: 100%;
  font-size: 10px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.layoutWarning {
  color: #86542f;
  background: #f2e8db;
  border-left: 2px solid #af8156;
  border-radius: 2px;
  padding: 7px 10px;
}
.muz3Bar #layoutNotice.layoutWarning {
  flex-basis: 100%;
  margin-left: 0;
  font-size: 11px;
}

/* Only the viewport container changes. Existing close-up layout keeps its rules. */
#stage:not(.inspecting) {
  height: calc(100dvh - 245px);
  min-height: 370px;
  margin-top: 10px;
}

.spaceTools {
  width: min(1040px, 100%);
  min-height: 44px;
  margin-top: 2px;
  gap: 6px 12px;
}
.spaceTools #spaceHint { line-height: 1.5; }
.spaceTools button {
  min-height: 44px;
  padding: 8px 10px;
  white-space: nowrap;
  color: #64566e;
}
.spaceTools button:hover:enabled { background: #ffffff70; }
.framingNotice {
  width: min(1040px, 100%);
  margin: 4px auto 6px;
  padding: 9px 12px;
  border-left: 2px solid #b49b7c;
  border-radius: 2px;
  background: #eee8de80;
  color: #796044;
  font-size: 11px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.presentationControls,
.resultAccess,
.experimentTools {
  width: min(1040px, 100%);
  min-width: 0;
  margin: 0 auto;
  color: #766a7e;
  font-size: 11px;
}
.presentationControls > summary,
.resultAccess > summary,
.experimentTools > summary,
.diagnostics > summary {
  width: fit-content;
  max-width: 100%;
  min-height: 44px;
  padding: 8px 0;
  line-height: 28px;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.presentationControls > summary::marker,
.resultAccess > summary::marker,
.experimentTools > summary::marker,
.diagnostics > summary::marker { color: #9a8da3; }
.presentationControls > summary:focus-visible,
.resultAccess > summary:focus-visible,
.experimentTools > summary:focus-visible,
.diagnostics > summary:focus-visible {
  outline: 2px solid #9381ae;
  outline-offset: 2px;
  border-radius: 4px;
}
.presentationControls[open] { padding-bottom: 8px; }
.presentationSliders { padding-top: 3px; }
.presentationSliders > label { grid-row: 1 / 3; }
.presentationSliders > label:first-child { grid-column: 1; }
.presentationSliders > label:nth-child(2) { grid-column: 2; }
#resetPresentation { grid-column: 3; grid-row: 1; }
#visitorPresentation {
  grid-column: 3;
  grid-row: 2;
  min-height: 44px;
  padding: 8px 12px;
  border-color: transparent;
  background: transparent;
  color: #55455f;
  font-size: 11px;
  white-space: nowrap;
}
#visitorPresentation:hover:enabled { background: #ffffff80; }
#visitorPresentation:disabled { opacity: .65; }
.quietMotionOption {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  min-height: 44px;
  line-height: 1.5;
  cursor: pointer;
}
.quietMotionOption input {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  margin: 0;
  accent-color: #766186;
}
#presentationHint { color: #7e7187; }

.artworkNav {
  min-height: 78px;
  padding: 8px 0 10px;
  border-bottom: 1px solid #d2cbd740;
  background: none;
}
.shelfHeading { font-size: 18px; }
#shelfEmpty { line-height: 1.5; }
.artShortcut { min-width: 44px; }
.detailNav button:not(.back) { min-width: 44px; min-height: 44px; }
.selectionHeading button { min-width: 44px; min-height: 44px; }

.experimentTools { padding-top: 2px; color: #817586; }
.experimentTools > label {
  display: grid;
  gap: 7px;
  width: min(360px, 100%);
  line-height: 1.5;
  padding: 6px 0;
}
.experimentTools select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid #d5ccd9;
  border-radius: 12px;
  background: #ffffff70;
  color: #55455f;
  font: inherit;
}
.experimentTools select:focus-visible { outline: 2px solid #9381ae; outline-offset: 3px; }
.experimentNote { max-width: 740px; margin: 8px 0 12px; line-height: 1.6; }
.experimentTools .diagnostics { margin: 0; padding-top: 0; border-top: 0; }
.experimentTools .diagnostics > summary { font-size: 11px; }

@media (max-width: 760px) {
  main { padding: 14px 16px 14px; }
  .searchBar { gap: 4px; }
  #query { font-size: 16px; }
  .queryOptions { padding: 0 6px; gap: 0 10px; }
  .muz3Bar { gap: 3px 12px; }
  #stage:not(.inspecting) { height: calc(100dvh - 245px); min-height: 360px; }
  .spaceTools { gap: 2px 8px; }
  .spaceTools #spaceHint { max-width: 55%; }
  .spaceTools button { padding: 8px; font-size: 11px; }
}

@media (max-width: 520px) {
  main { padding: 12px 12px 14px; }
  #newSearch { padding: 8px; font-size: 11px; }
  #undo { padding: 6px 8px; }
  .queryOptions { padding: 0 2px; gap: 0 6px; }
  .queryOptions label { flex: 1 1 auto; min-width: 0; }
  .zoomControls button { min-width: 44px; padding: 3px 8px; }
  .muz3Bar { align-items: flex-start; padding-top: 4px; }
  .muz3Identity { gap: 3px 10px; }
  .muz3Identity small { font-size: 10px; }
  .muz3Bar #layoutNotice { margin-left: 0; }
  #stage:not(.inspecting) { height: calc(100dvh - 270px); min-height: 340px; margin-top: 8px; }
  .spaceTools { flex-wrap: wrap; }
  .spaceTools #spaceHint { flex: 1 1 100%; max-width: 100%; padding-top: 5px; }
  .spaceTools #homeView { margin-left: 0; }
  .spaceTools #centerSpace { margin-left: -8px; }
  #presentationSummary { margin-left: 7px; }
  .presentationSliders > label { grid-row: 1; }
  #resetPresentation { grid-column: 1; grid-row: 2; margin-left: 0; }
  #visitorPresentation { grid-column: 2; grid-row: 2; justify-self: start; }
  .artworkNav { flex-wrap: wrap; gap: 4px 12px; }
  .shelfHeading { font-size: 16px; }
  #shelfEmpty { flex: 1 1 150px; margin: 8px 0; font-size: 11px; }
  #artworks:empty { display: none; }
  #artworks:not(:empty) { flex: 1 1 180px; }
}

/* Integrated visitor surface: keep actions, errors and fallback warnings. */
#referenceInfo, #spaceHint, #presentationHint { display: none; }
#layoutNotice:not(.layoutWarning) { display: none; }
.muz3Identity { font-size: 10px; opacity: .58; }
.muz3Bar { min-height: 18px; }
.queryOptions { min-height: 38px; }
#stage:not(.inspecting) { height: calc(100dvh - 210px); }
.spaceTools { justify-content: flex-end; }
.presentationControls > summary, .resultAccess > summary { min-height: 36px; padding: 4px 0; }
#experimentTools[hidden], .artworkNav[hidden] { display: none; }
@media (max-width: 600px) {
  main { padding: 14px 16px; }
  #stage:not(.inspecting) { height: calc(100dvh - 205px); min-height: 340px; }
}

/* Minimal visitor surface. History takes its own space above the canvas. */
main { height: 100dvh; }
.searchShell { width: min(1040px, 100%); flex: 0 0 auto; margin: 0 auto; }
.searchShell .searchBar { width: 100%; }
#historyToggle {
  flex: 0 0 44px; width: 44px; min-height: 44px; padding: 0;
  border: 0; background: transparent; font-size: 22px; color: #786a84;
}
#historyToggle[aria-expanded="true"] { transform: rotate(180deg); }
#branchTrail {
  position: static; display: block; width: 100%; max-height: 210px; overflow: auto;
  margin: 8px 0 0; padding: 6px 14px; border: 1px solid #dfdae2;
  border-radius: 18px; background: #fff9;
}
#branchTrail button {
  display: block; width: 100%; min-height: 44px; border: 0;
  border-radius: 9px; padding: 10px 12px; text-align: left;
  background: transparent; overflow-wrap: anywhere; font-size: 13px;
}
#branchTrail button:hover:enabled { background: #e9e5ee80; }
#branchTrail button[aria-current="true"] { opacity: 1; color: #8e8397; }
#branchTrail #branchBack { color: #786a84; font-size: 11px; }
#presentationControls, #resultAccess { display: none !important; }
.muz3Bar:not(:has(.layoutWarning)) { display: none; }
.queryOptions, .spaceTools, .muz3Bar, .framingNotice, .artworkNav, .experimentTools { flex-shrink: 0; }
#stage:not(.inspecting) { flex: 1 1 340px; height: auto; max-height: none; min-height: 340px; }
body[data-phase="entry"] main { justify-content: center; }
body[data-phase="entry"] .searchShell { width: min(680px, 100%); }
body[data-phase="entry"] main > :not(.searchShell):not(#error):not(.artworkNav) { display: none !important; }
body[data-phase="entry"] #undo, body[data-phase="entry"] #newSearch { display: none; }
@media (max-width: 520px) {
  #branchTrail { padding: 4px 8px; }
}

/* The collection is independent of the current search and remains reachable on reload. */
.artworkNav { flex-wrap:wrap; align-items:center; gap:6px 14px; }
#artworks { min-width:0; flex:1 1 180px; }
#collectionTools { flex:1 0 100%; font-size:12px; }
#collectionTools summary { cursor:pointer; width:max-content; min-height:28px; padding:5px 0; }
#collectionTools p { max-width:760px; line-height:1.5; color:#766b7c; margin:4px 0 10px; }
.collectionToolsRow,.collectionActions { display:flex; flex-wrap:wrap; gap:6px; }
.collectionToolsRow button,.collectionActions button { min-height:44px; font-size:12px; }
.collectionActions { border-top:1px solid #d5cdda; padding-top:10px; margin:10px 0; }
#saveArtwork[aria-pressed="true"] { background:#e6deed; border-color:#9683a6; }
#collectionStatus,#collectionMessage { flex:1 0 100%; margin:2px 0; font-size:12px; line-height:1.5; }
#collectionStatus,#collectionMessage[data-error="true"] { color:#8f2e2e; }
#collectionMessage:empty { display:none; }
.artShortcut[data-known="false"] { border:1px dashed #9e8b63; width:120px; flex-basis:120px; }
.decisions { flex-wrap:wrap; }

/* Failed or missing images never remove the ranked record or its controls. */
.point.textFallback {
  min-width: 112px; max-width: 180px; min-height: 64px; padding: 9px;
  background: #f6f3edee; border: 1px solid #c5baca; color: #51485b;
  border-radius: 10px; font-size: 12px; line-height: 1.35;
  overflow: hidden; overflow-wrap: anywhere; box-shadow: 0 3px 12px #51405c14;
}
.point.textFallback:hover { background: #fffdf7; border-color: #9381ae; }
#imageStatus { color: #796044; font-size: 12px; line-height: 1.5; }
#artRights { color: #766d80; font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
