/* Desktop painting workspace. Controls occupy their own space around the artwork. */
body.explorer {
  --paper: #e9e4d9;
  --muted: #a39f94;
  --gold: #d2af70;
  --edge: #36372f;
  --panel: #1b1e1b;
  margin: 0;
  background: #111411;
  color: var(--paper);
  font: 14px/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow: hidden;
}
.explorer #explorerApp { height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: #111411; }
.explorer a { color: var(--gold); }
.explorer button, .explorer .button-link, .explorer select {
  border: 1px solid #484a3f;
  border-radius: 5px;
  padding: 7px 11px;
  background: #272b25;
  color: var(--paper);
  cursor: pointer;
  font: inherit;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
}
.explorer button:hover, .explorer .button-link:hover { background: #363b30; border-color: #80785e; }
.explorer button[aria-pressed="true"], .explorer button[aria-expanded="true"] { border-color: var(--gold); color: #f0d59c; background: #333329; }
.explorer button:disabled { opacity: 0.4; cursor: default; }
.explorer :focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.explorer .icon-button { width: 34px; height: 34px; padding: 0; flex: 0 0 auto; font-size: 22px; }
.explorer-header { min-height: 76px; padding: 13px 22px; border-bottom: 1px solid var(--edge); display: flex; align-items: center; justify-content: space-between; gap: 22px; background: #1a1d19; }
.explorer-brand { display: flex; gap: 12px; align-items: center; color: var(--paper) !important; text-decoration: none !important; flex-shrink: 0; }
.brand-mark { color: var(--gold); font-size: 39px; line-height: 1; }
.explorer-brand strong { display: block; font-family: Georgia, serif; letter-spacing: 0.18em; font-size: 19px; font-weight: normal; line-height: 1.3; }
.explorer-brand small { display: block; font-size: 10px; color: var(--muted); letter-spacing: 0.07em; }
.workspace-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.workspace-actions button { font-size: 12px; white-space: nowrap; }
.workspace-languages { display: flex; gap: 10px; font-size: 12px; }
.workspace-languages a { color: var(--muted); padding: 6px 0; }
.workspace-languages a[aria-current] { color: var(--gold); border-bottom: 1px solid var(--gold); }
.explorer-workspace { display: flex; flex: 1; min-height: 0; overflow: hidden; }
.explorer-panel { background: var(--panel); flex-shrink: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #595b4b transparent; padding: 20px; }
.library-panel { width: 258px; border-right: 1px solid var(--edge); display: flex; flex-direction: column; }
.info-panel { width: 326px; border-left: 1px solid var(--edge); }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 22px; }
.explorer .panel-heading .icon-button { border: none; background: none; color: var(--muted); width: 24px; height: 24px; }
.explorer .panel-heading h1 { font: 19px/1.3 Georgia, serif; color: var(--paper); margin: 0; }
.eyebrow { font-size: 10px; letter-spacing: 0.15em; color: var(--muted); }
.search-label { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.explorer input[type="search"], .explorer #shareInput { background: #111510; color: var(--paper); border: 1px solid #4b4d42; border-radius: 5px; padding: 10px; width: 100%; min-width: 0; font-size: 12px; }
.explorer input[type="checkbox"], .explorer input[type="range"] { accent-color: var(--gold); }
.explorer input[type="checkbox"] { width: 15px; height: 15px; flex-shrink: 0; }
.explorer summary { cursor: pointer; color: var(--paper); padding: 12px 0; font-size: 12px; }
.explorer details { border-top: 1px solid var(--edge); }
.filter-section { margin-top: 15px; }
.filter-actions { display: flex; gap: 6px; margin-bottom: 10px; }
.filter-actions button { font-size: 11px; padding: 4px 10px; }
#filterCount { color: var(--muted); }
.explorer #typeFilters { position: static; display: flex; flex-direction: column; padding: 0; margin: 0 0 10px; background: none; max-height: 230px; overflow: auto; }
.explorer #typeFilters label, .option-row { display: flex; gap: 7px; align-items: center; font-size: 12px; color: var(--paper); margin: 0; padding: 5px 0; cursor: pointer; }
.explorer .muted { color: var(--muted); font-size: 11px; }
#resultCount { margin: 6px 0; }
.region-list { overflow: auto; flex: 1 0 140px; min-height: 140px; max-height: 40vh; margin: 0 -7px 18px; padding: 3px 7px; scrollbar-width: thin; }
.explorer .region-button { width: 100%; display: flex; align-items: center; justify-content: space-between; text-align: left; background: transparent; border: 1px solid transparent; border-bottom-color: #30342c; border-radius: 0; font-size: 12px; padding: 9px 5px; gap: 8px; }
.region-button span { display: block; }
.region-button small { display: block; color: var(--muted); font-size: 10px; }
.explorer .region-button[aria-pressed="true"] { border-color: var(--gold); border-radius: 3px; padding-left: 8px; }
.region-button .region-arrow { color: var(--gold); }
.explorer .variant-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 0 0 10px; }
.explorer .layer-button { font-size: 11px; padding: 7px 3px; }
.about-section { margin-top: 14px; }
.project-links { display: flex; flex-direction: column; gap: 8px; font-size: 12px; }
.painting-workspace { min-width: 0; min-height: 0; flex: 1; display: flex; flex-direction: column; padding: 0 18px; }
.painting-caption { display: flex; justify-content: space-between; gap: 12px; padding: 13px 0; color: var(--muted); font-size: 10px; letter-spacing: 0.02em; min-height: 42px; }
#activeLayer { color: var(--gold); text-align: right; }
.painting-viewport { position: relative; flex: 1; min-height: 120px; overflow: hidden; background: #0c0e0c; box-shadow: 0 0 25px #0004; }
.explorer #paintingCanvas { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; display: block; cursor: grab; touch-action: none; }
.explorer #paintingCanvas.dragging { cursor: grabbing; }
.hover-label { position: absolute; pointer-events: none; background: #121710ee; border: 1px solid #77745c; color: #fff; padding: 5px 9px; font-size: 12px; border-radius: 4px; max-width: min(240px, 90%); }
#compareDivider { position: absolute; height: 100%; top: 0; width: 2px; background: #f5dfb1; pointer-events: none; box-shadow: 0 0 5px #000; }
.image-label { position: absolute; bottom: 10px; background: #111b; color: #f6eedc; padding: 3px 7px; font-size: 10px; pointer-events: none; }
.original-label { left: 10px; }
.interpretation-label { right: 10px; }
.compare-controls { display: flex; align-items: center; gap: 12px; min-height: 38px; font-size: 11px; }
.compare-controls input { min-width: 50px; flex: 1; }
.viewer-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--edge); }
.view-buttons { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.view-buttons button, .view-mode-label, .explorer select { font-size: 11px; }
.view-buttons .icon-button { width: 30px; height: 30px; font-size: 20px; }
#zoomLevel { min-width: 40px; text-align: center; font-size: 11px; font-variant-numeric: tabular-nums; }
.view-mode-label { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.viewer-foot { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 12px 0; min-height: 112px; }
.viewer-help { min-width: 0; flex: 1; }
.viewer-help p { font-size: 10px; color: var(--muted); margin: 2px 0; }
.viewer-help #imageStatus { color: #c5b787; }
.explorer #coords { position: static; width: auto; font: 10px/1.5 monospace; background: none; color: var(--muted); padding: 0; border: 0; }
.overview { width: 104px; flex-shrink: 0; position: relative; }
.overview span { display: block; color: var(--muted); font-size: 9px; margin-bottom: 4px; }
#overviewCanvas { width: 104px; height: 87px; display: block; border: 1px solid #74715f; cursor: crosshair; }
.explorer #magnifierCanvas { position: static; width: 130px; height: 101px; border: 1px solid #74715f; display: block; background: #0b0e0a; }
.intro-kicker { font-size: 11px; color: var(--gold); margin: 12px 0; }
.explorer .info-panel h2 { font: normal 32px/1.2 Georgia, serif; letter-spacing: -0.02em; color: var(--paper); margin: 0 0 20px; }
.explorer .info-panel p { font-size: 12px; line-height: 1.75; }
.explorer .primary-button { background: var(--gold); border-color: var(--gold); color: #1c2117; font-weight: 600; }
.explorer .primary-button:hover { background: #e7c789; border-color: #e7c789; }
#welcomeTour, #exploreFreely { display: flex; justify-content: space-between; width: 100%; margin-top: 13px; font-size: 12px; padding: 11px; }
#welcomeTour { margin-top: 28px; }
.welcome-steps { padding-left: 18px; margin-top: 30px; color: var(--muted); font-size: 11px; }
.welcome-steps li { padding-left: 4px; margin-bottom: 15px; }
.attribution { color: var(--muted); border-top: 1px solid var(--edge); padding-top: 20px; margin-top: 28px; font-size: 10px !important; }
.selection-crop { margin: 0 0 20px; }
.selection-crop img { display: block; width: 100%; height: 174px; object-fit: contain; background: #10130e; border: 1px solid #3a3c31; }
.selection-crop figcaption { color: var(--muted); font-size: 9px; margin-top: 6px; }
.reading-section { margin: 20px 0; }
.reading-section h3 { color: var(--paper); font-size: 12px; margin: 0 0 7px; font-weight: 600; }
.reading-section p { margin: 0; color: #c4c2b9; }
.interpretation-note { border-left: 2px solid #9b8053; padding-left: 13px; }
#compareSelection { margin-top: 12px; font-size: 11px; }
.selection-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 24px 0; }
.selection-actions > * { font-size: 11px !important; }
#pageButton, #shareButton { grid-column: 1 / -1; }
.explorer #shareButton { margin: 0; }
.source-details p, .source-details li, .source-details a { font-size: 11px !important; }
.source-details ul { padding-left: 18px; }
.source-details li { margin-bottom: 8px; }
.tour-controls { border: 1px solid #6d6249; padding: 10px; border-radius: 5px; margin-bottom: 20px; }
#tourProgress { font-size: 11px; color: var(--gold); }
.tour-controls > div { display: flex; gap: 6px; margin-top: 8px; }
.tour-controls button { font-size: 10px; padding: 5px 8px; }
#tourEnd { margin-left: auto; }
.explorer #sharePopup { position: fixed; inset: 0; top: 0; transform: none; margin: auto; width: min(90vw, 560px); height: fit-content; max-height: 90vh; padding: 26px; background: #20241d; border: 1px solid #8e7b57; border-radius: 10px; color: var(--paper); text-align: left; overflow: auto; z-index: 100; }
.explorer #sharePopup:not([open]) { display: none; }
.explorer #sharePopup[open] { display: block; }
.explorer #sharePopup::backdrop { background: #000a; }
.explorer #sharePopup form { float: right; }
.explorer #sharePopup h2 { font: normal 28px Georgia, serif; }
.explorer #sharePopup label { display: block; margin: 18px 0 7px; }
.explorer #shareInput { font-size: 13px; margin: 0 0 14px; }
.explorer #shareClose { width: 30px; height: 30px; padding: 0; }
.workspace-message { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #e0c48e; color: #1e2317; padding: 10px 18px; border-radius: 5px; box-shadow: 0 3px 20px #0008; max-width: 90vw; z-index: 90; }
.no-script { position: fixed; bottom: 0; left: 0; right: 0; background: #332e21; padding: 20px; z-index: 99; }
@media (min-width: 1800px) {
  .library-panel { width: 280px; padding: 26px; }
  .info-panel { width: 360px; padding: 26px; }
  .painting-workspace { padding: 0 28px; }
  .explorer .info-panel p { font-size: 14px; }
  .selection-crop img { height: 210px; }
}
@media (max-width: 1150px) {
  .explorer-header { gap: 12px; padding: 12px; }
  .explorer-brand small { display: none; }
  .explorer-brand strong { font-size: 16px; }
  .brand-mark { font-size: 28px; }
  .workspace-actions { gap: 5px; }
  .workspace-actions button { font-size: 11px; padding: 7px; }
  .library-panel { width: 220px; padding: 15px; }
  .info-panel { width: 280px; padding: 18px; }
  .painting-workspace { padding: 0 12px; }
  .painting-caption { font-size: 9px; }
}
@media (max-width: 900px), (max-height: 550px) {
  body.explorer { overflow: auto; }
  .explorer #explorerApp { height: auto; min-height: 100dvh; }
  .explorer-header { flex-wrap: wrap; }
  .workspace-languages { margin-left: auto; }
  .workspace-actions { order: 2; width: 100%; margin: 0; }
  .workspace-actions button { flex: 1; min-height: 40px; }
  .explorer-workspace { display: flex; flex-direction: column; overflow: visible; }
  .painting-workspace { order: 0; flex: none; padding: 0 12px; }
  .painting-viewport { flex: none; height: clamp(240px, 55vh, 700px); }
  .explorer-panel { width: 100%; border: 0; border-top: 1px solid var(--edge); overflow: visible; }
  .info-panel { order: 1; }
  .library-panel { order: 2; }
  .region-list { max-height: 350px; flex-basis: auto; }
  .painting-caption { font-size: 9px; min-height: 40px; }
  .view-buttons { gap: 5px; }
  .viewer-toolbar { gap: 10px; }
  .viewer-toolbar button, .explorer select { min-height: 40px; }
  .viewer-foot { min-height: 96px; }
  .overview, #overviewCanvas { width: 80px; }
  #overviewCanvas { height: 67px; }
  .explorer #magnifierCanvas { width: 100px; height: 78px; }
  .selection-crop img { height: 230px; }
  .explorer .info-panel h2 { font-size: 29px; }
  .option-row, .explorer #typeFilters label { min-height: 40px; }
  .explorer .region-button { min-height: 44px; }
  .explorer .variant-controls { grid-template-columns: repeat(3, 1fr); }
  .explorer .layer-button { min-height: 40px; }
  .explorer #explorerApp:fullscreen { overflow-y: auto; height: 100dvh; }
}
@media (prefers-reduced-motion: no-preference) {
  .explorer button { transition: background-color 120ms, border-color 120ms; }
}
/* Override the legacy fixed magnifier button used by the previous canvas. */
.explorer #toggleMagnifier { position: static; top: auto; right: auto; padding: 7px 11px; font-size: 11px; background: #272b25; }
.explorer #toggleMagnifier[aria-pressed="true"] { background: #333329; }
.explorer .region-button { font-size: 13px; }
.explorer .info-panel p { font-size: 13px; }
