:root {
  font: 15px/1.5 "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --paper: #f6f3ec; --surface: #fffdf8; --ink: #282922; --muted: #6d6a60;
  --line: #ded9ce; --accent: #943c26; --accent-dark: #752e1d;
  background: var(--paper); color: var(--ink);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .44; cursor: default; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid #ac522b; outline-offset: 3px; }
.top { height: 72px; border-bottom: 1px solid var(--line); background: #faf8f2; display: flex; align-items: center; justify-content: space-between; padding-inline: max(4vw, calc((100% - 1390px) / 2)); }
.brand { display: inline-flex; align-items: center; gap: 12px; font-family: "Songti SC", "Noto Serif SC", serif; font-size: 24px; font-weight: 700; white-space: nowrap; }
.brand small { font: 600 9px/1 system-ui, sans-serif; letter-spacing: .15em; margin-left: 7px; color: #6c6454; }
.brand-icon { display: inline-block; width: 28px; height: 28px; background: var(--accent); position: relative; }
.brand-icon::before { content: ''; position: absolute; inset: 5px 7px; border: 1px solid #f8e5d6; border-radius: 12px 12px 0 0; }
.top nav { display: flex; gap: 18px; align-items:center; font-size: 13px; font-weight: 650; color: var(--muted); }
.top nav a[aria-current] { color: var(--accent); }
#root, .site-foot { width: min(92%, 1390px); margin-inline:auto; }
#root { min-height: 73vh; }
.section-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin: 29px 0 16px; }
.eyebrow, .intro-kicker { margin: 0 0 4px; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .15em; }
h2, h3, p { margin: 0; }
.section-top h2 { font: 700 clamp(27px, 3vw, 43px)/1.15 "Songti SC","Noto Serif SC",serif; }
.metrics { display: flex; flex-wrap: wrap; gap: 7px; }
.metrics span { padding: 4px 10px; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); font-size: 11px; background: #fbf8f2; }
.stage { position: relative; height: clamp(430px, 65vh, 720px); border: 1px solid #cfc4b5; border-radius: 5px; background: #e6dac7; isolation: isolate; container-type: inline-size; }
.scene { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; }
.entrance .scene, .exit .scene { background: #e3c49e url("/entrance.jpg") center center / cover no-repeat; }
.exit .scene { background-position: 60% center; }
.intro { position: absolute; z-index: 1; top: 43%; transform: translateY(-42%); left: 6%; width: min(39%, 510px); max-height: 83%; overflow: auto; padding: 8px 3px 8px 0; color: #31271f; }
.intro h1 { font: 700 clamp(29px, 5.25cqw, 76px)/1.08 "Songti SC", "Noto Serif SC", serif; letter-spacing: -.055em; margin: 11px 0 18px; overflow-wrap: anywhere; }
.intro p { color: #49362a; font-size: clamp(13px, 1.22cqw, 17px); line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.intro .primary { margin-top: 22px; }
.primary, .secondary { border: 1px solid transparent; padding: 9px 14px; border-radius: 4px; font-size: 13px; font-weight: 650; background: var(--accent); color: white; display: inline-flex; align-items: center; justify-content: center; gap: 11px; white-space: nowrap; }
.primary:hover:enabled, a.primary:hover { background: var(--accent-dark); }
.secondary { color: var(--ink); background: var(--surface); border-color: var(--line); }
.secondary:hover:enabled, a.secondary:hover { border-color: #ab8b76; }
.map { position: absolute; z-index: 6; top: 16px; right: 16px; width: 258px; border-radius: 5px; background: rgba(255,253,247,.97); border: 1px solid #ded4c6; box-shadow: 0 4px 16px #34200e18; padding: 10px; }
.map:not([open]) { width: auto; }
.map summary { cursor: pointer; font-weight: 700; font-size: 13px; list-style-position: inside; }
.map-icon { color: var(--accent); margin-left: 3px; }
.legend { display: flex; align-items: center; gap: 4px; color: #686158; font-size: 10px; margin-top: 7px; }
.legend i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.legend span { margin-left: auto; }
.wall, .stage.stand { --light: #eae2d1; --shade: #d0c3ac; --side: #bbad95; }
.sage { --light: #dce0d1; --shade: #b6beab; --side: #98a08c; }
.rose { --light: #eaddd5; --shade: #cbb6ae; --side: #b1988b; }
.stage.stand.sand, .sand { --light: #e5d2b5; --shade: #c7b091; --side: #ad9372; }
.ceiling, .side, .floor, .back-wall { position: absolute; inset: 0; }
.ceiling { background: linear-gradient(#9f978c,#eae5d8 18%); clip-path: polygon(0 0,100% 0,92% 16%,8% 16%); }
.ceiling::before { content: ''; position: absolute; top: 6%; left: 13%; width: 74%; height: 3px; background: #5b574b; box-shadow: 0 0 11px #fff8d9; }
.side-left { background: linear-gradient(105deg,var(--side),var(--shade) 11%); clip-path: polygon(0 0,8% 16%,8% 83%,0 100%); }
.side-right { background: linear-gradient(255deg,var(--side),var(--shade) 11%); clip-path: polygon(100% 0,92% 16%,92% 83%,100% 100%); }
.back-wall { inset: 16% 8% 17%; background: radial-gradient(ellipse at 50% 5%, #fff9eccc, transparent 63%),linear-gradient(var(--light),var(--shade)); border-bottom: 5px solid #6b51402f; }
.floor { background: repeating-conic-gradient(from -88deg at 50% -80%, #fff0 0 8deg,#4237231c 8deg 8.3deg), repeating-linear-gradient(transparent 0 25px,#201b1318 26px 27px),linear-gradient(#cab79a,#f1dfc1); clip-path: polygon(8% 83%,92% 83%,100% 100%,0 100%); }
.wall-label { position: absolute; top: 7%; left: 12%; max-width: 52%; color:#392f26; line-height: 1.2; }
.wall-label strong { display: block; font: 700 clamp(17px, 2.6cqw, 36px)/1.2 "Songti SC","Noto Serif SC",serif; overflow-wrap: anywhere; }
.wall-label span { display:block; margin-top: 5px; font-size: clamp(10px, 1.15cqw, 15px); }
.art-slot { position: absolute; left: var(--x); top: var(--y); width: var(--w); height: var(--h); transform: translate(-50%,-50%); background: transparent; border: 0; padding: 0; z-index: 1; }
.art-slot:hover, .art-slot:focus-visible, .art-slot.selected { z-index: 4; outline: 2px solid var(--accent); outline-offset: 3px; }
.art-image { display: grid; place-items: center; width:100%; height:100%; overflow:hidden; }
.art-image img { display: block; width:100%; height:100%; object-fit: contain; }
.frame .art-image { background: #fbf7ec; box-shadow: inset 0 0 0 clamp(3px,.48cqw,8px) #5b4234, inset 0 0 0 clamp(5px,.8cqw,11px) #cfb391, 4px 9px 12px #3b2a2250; padding: 6%; }
.empty-art { color:#a99a86; font-size: clamp(12px,2.3cqw,28px); line-height: 1; }
.art-tag { position:absolute; bottom: -17px; left: 50%; transform: translateX(-50%); padding: 1px 4px; background: #fffcf2dd; border-radius: 2px; max-width: 100%; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; font-size: 9px; line-height: 13px; color: #433527; }
.art-slot.stand .art-image { height: 70%; position: absolute; bottom: 29%; z-index: 1; }
.plinth { position: absolute; bottom: 0; left: 5%; width: 90%; height:32%; background: linear-gradient(90deg,#f4e8d2 76%,#afa08a 76.5%); box-shadow: 6px 9px 14px #5f453f46; }
.plinth::before { content:''; display:block; position:absolute; bottom:100%; width:100%; height:26%; clip-path:polygon(12% 0, 86% 0, 100% 100%,0 100%); background:#f7eddd; }
.tour-controls { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items:center; min-height: 78px; border-bottom: 1px solid var(--line); }
.position { display: flex; align-items: center; gap: 11px; font-size: 14px; }
.position small { display:block; font-size: 11px; color:var(--muted); }
.position-index { background: #ece2d5; color:var(--accent); border-radius: 4px; padding: 6px 9px; font-weight: 750; font-variant-numeric: tabular-nums; }
.steps, .editor-tools { display:flex; gap:8px; align-items: center; }
.keyboard-tip { color:var(--muted); justify-self: end; font-size: 11px; white-space: nowrap; }
kbd { display:inline-block; background:#fcf9f1; border:1px solid var(--line); padding:0 4px; border-radius:2px; }
.site-foot { display:flex; justify-content:space-between; align-items:center; gap:12px; color: var(--muted); padding: 20px 0; font-size:10px; letter-spacing:.06em; }
.editor-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(275px,325px); gap: 15px; align-items: start; }
.editor-main, .inspector { background:var(--surface); border:1px solid var(--line); border-radius:5px; padding:16px; min-width:0; }
.editor-bar { display:flex; justify-content:space-between; gap:6px; align-items:center; }
#save-state { color:var(--muted); font-size:12px; }
.route-tabs { display:flex; gap:5px; align-items:center; flex-wrap: wrap; margin: 11px 0; }
.route-tabs > span { color: var(--muted); }
.route-tabs button, .zoom-controls button { border:1px solid var(--line); border-radius:3px; background: #f7f2e9; color:var(--ink); padding:5px 8px; font-size:12px; }
.route-tabs button[aria-pressed=true] { background:var(--accent); color:white; border-color:var(--accent); }
.add-area { display:flex; flex-wrap:wrap; gap:12px; margin: 0 0 10px; }
.text-button { border:0; background:transparent; color:var(--accent); padding: 4px 0; font-size:12px; font-weight:650; }
.text-button:hover { text-decoration:underline; }
.editing-preview .stage { height:auto; min-height:310px; aspect-ratio: 1.85; }
.inspector h3 { font-size:17px; margin-bottom: 9px; }
.muted { color:var(--muted); font-size:12px; margin-bottom: 10px; }
.inspector-actions { display:flex; gap:5px; flex-wrap:wrap; margin-bottom:10px; }
.inspector-actions .secondary { padding:4px 7px; font-size:11px; }
.inspector-actions .danger { margin-left:auto; }
.field { display:block; margin-bottom: 9px; font-size:12px; }
.field > span { display:flex; justify-content:space-between; align-items:center; gap:4px; margin-bottom:4px; font-weight: 650; }
.field :is(input:not([type=range]),select,textarea) { width:100%; padding:7px 8px; border:1px solid var(--line); background:#fbf9f4; color:var(--ink); border-radius:3px; }
textarea { min-height:73px; resize:vertical; }
.field input[type=range] { width:100%; accent-color:var(--accent); margin:0; }
.object-section { border-top:1px solid var(--line); margin-top:14px; padding-top:13px; }
.upload { display:grid; gap:2px; background: #f8efe3; border:1px dashed #c28b70; border-radius:3px; padding:9px; margin-bottom:9px; color:var(--accent); cursor:pointer; font-size:12px; }
.upload small { color:var(--muted); }
.upload input { width:100%; font-size:10px; color:var(--muted); }
.coordinates { display:grid; grid-template-columns:1fr 1fr; gap:5px 12px; }
dialog { border:1px solid var(--line); border-radius:6px; padding:0; width:min(880px,94vw); max-height:92dvh; background:var(--surface); color:var(--ink); box-shadow: 0 12px 50px #20171065; }
dialog:has(.auth) { width:min(400px,92vw); }
dialog::backdrop { background:#241a15a8; }
.detail-head { display:flex; justify-content:space-between; align-items:center; padding:10px 16px; border-bottom:1px solid var(--line); }
.detail-head button { padding:0 9px; font-size:22px; }
.detail-body { display:grid; grid-template-columns:minmax(0,2fr) minmax(0,1fr); }
.zoom-panel { background:#eee7dc; min-width:0; padding:12px; }
.zoom-image { height:min(50vh,460px); display:block; text-align:center; overflow:auto; font-size:12px; color:var(--muted); }
.zoom-image img { display:inline-block; vertical-align:middle; width:auto; height:auto; max-width: calc(100% * var(--zoom)); max-height: calc(min(50vh,460px) * var(--zoom)); }
.zoom-image span { display:grid; height:100%; place-items:center; }
.zoom-controls { display:flex; justify-content:center; align-items:center; gap:8px; margin-top:10px; }
.zoom-controls output { min-width:45px; text-align:center; font-variant-numeric: tabular-nums; }
.detail-copy { padding:22px; overflow-wrap:anywhere; }
:is(.detail-copy,.work-copy-preview) dt { color:var(--muted); font-size:12px; margin-top:12px; }
:is(.detail-copy,.work-copy-preview) dd { margin:4px 0 0; white-space:pre-wrap; }
.work-copy-preview { margin-top:16px; padding:16px; border:1px solid var(--line); background:#fbf9f4; overflow-wrap:anywhere; }
.work-copy-preview h2 { font-size:20px; }
.auth { padding:20px; }
.auth h2 { margin-bottom:12px; }
.auth-error { color:var(--accent); font-size:12px; margin-bottom:12px; }
.auth .editor-tools { justify-content:flex-end; }
#toast { position:fixed; z-index: 10; bottom:20px; left:50%; transform:translate(-50%,10px); max-width:85vw; color:#fff7ed; background:#342921; padding:9px 14px; border-radius:4px; opacity:0; pointer-events:none; transition:opacity .15s,transform .15s; }
#toast.visible { opacity:1; transform:translate(-50%,0); }
@media(max-width:850px) {
  .map { width:205px; }
  .stage { height:clamp(390px, 58vh, 580px); }
}
@media(max-width:680px) {
  .top { height:60px; }
  .brand small, .keyboard-tip { display:none; }
  .top nav { gap:12px; }
  .section-top { margin-top:17px; align-items:center; }
  .metrics { justify-content:flex-end; }
  .stage { height:440px; }
  .entrance .scene, .exit .scene { background-image: linear-gradient(90deg,#ead1b0eb 0%,#ead1b0bd 50%,#ead1b00f 80%),url("/entrance.jpg"); }
  .intro { width:78%; top:51%; max-height:58%; }
  .intro h1 { font-size:clamp(30px,8cqw,50px); }
  .map { top:6px; right:6px; width:168px; padding:5px; }
  .map summary { font-size:11px; }
  .legend { display:none; }
  .tour-controls { grid-template-columns:minmax(0,1fr) auto; gap:6px; }
  .position { min-width:0; gap:5px; }
  .position-index { padding:4px 6px; }
  .primary,.secondary { padding:7px 8px; font-size:12px; gap:5px; }
  .editor-grid { grid-template-columns:1fr; }
  .editor-main, .inspector { padding:11px; }
  .detail-body { grid-template-columns:1fr; }
  .zoom-image { height:38vh; }
  .zoom-image img { max-height:calc(38vh * var(--zoom)); }
}
.sync-tools { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:10px; }
.stage:is(.wall,.stand):has(.map) { display:grid; grid-template-columns: minmax(0,1fr) 218px; gap:10px; background:#eae3d6; }
.stage:is(.wall,.stand):has(.map) .scene { position:relative; }
.stage:is(.wall,.stand) .map { position:relative; width:auto; right:auto; top:auto; align-self:start; margin:10px 10px 0 0; }
.stage:is(.wall,.stand) .wall-label { top: 5%; }
.zoom-image img { width:calc(100% * var(--zoom)); height:calc(min(50vh,460px) * var(--zoom)); max-width:none; max-height:none; object-fit:contain; }
@media(max-width:680px) {
  .stage:is(.wall,.stand):has(.map) { height:auto; grid-template-columns:1fr; gap:0; }
  .stage:is(.wall,.stand):has(.map) .scene { grid-row:2; min-height:330px; }
  .stage:is(.wall,.stand) .map { grid-row:1; width:min(100% - 12px, 270px); justify-self:end; margin:6px; }
  .stage:is(.wall,.stand) .map:not([open]) { width:auto; }
  .zoom-image img { height:calc(38vh * var(--zoom)); }
}
.intro h1 { text-wrap: balance; }
.view-closed .top nav { display:none; }
.view-closed .brand { pointer-events:none; }
.closed-hall { display:grid; place-items:center; min-height:min(72vh,680px); text-align:center; margin-top:24px; border:1px solid var(--line); border-radius:5px; padding:24px; background: radial-gradient(ellipse at 30% 20%,#fffaf0,#ede1ce); }
.closed-hall h1 { font:700 clamp(28px,5vw,60px)/1.3 "Songti SC","Noto Serif SC",serif; margin:8px 0 15px; color:var(--ink); }
.closed-hall p:not(.eyebrow) { color:var(--muted); margin-top:4px; }
.login-hall button { margin-top:18px; }

/* The viewport stays mounted while the camera moves through the building. */
.has-tour #root { min-height: 0; }
.tour-head { display:flex; align-items:flex-end; justify-content:space-between; gap:16px; margin:22px 0 14px; }
.tour-head h2 { font:700 clamp(27px,3vw,40px)/1.12 "Songti SC","Noto Serif SC",serif; }
.tour-metrics { margin-bottom:3px; padding:4px 9px; background:#fbf8f1; border:1px solid var(--line); border-radius:3px; color:var(--muted); font-size:11px; white-space:nowrap; }
.tour-stage, .preview-tour { position:relative; height:clamp(470px,69vh,860px); border:1px solid #bca98d; background:#cbb99c; border-radius:5px; overflow:hidden; isolation:isolate; }
.preview-tour { height:min(64vh,610px); border:0; border-radius:0; }
.tour-canvas { display:block; width:100%; height:100%; cursor:grab; touch-action:none; }
.tour-canvas.dragging { cursor:grabbing !important; }
.tour-vignette { position:absolute; inset:0; pointer-events:none; background:linear-gradient(0deg,#23181140,transparent 24%,transparent 82%,#2017090d); }
.tour-map { position:absolute; top:16px; right:16px; width:min(245px,40%); padding:10px; border:1px solid #a58a71; border-radius:5px; background:#fffaf1f5; color:#3c332b; box-shadow:0 5px 17px #331f1728; }
.tour-map:not([open]) { width:auto; }
.tour-map summary { cursor:pointer; font-weight:750; font-size:12px; padding:1px 3px; }
.architectural-plan { position:relative; display:block; width:100%; margin-top:5px; background:#ebe5d9; border-radius:3px; }
.architectural-plan canvas { display:block; position:absolute; inset:0; width:100%; height:100%; pointer-events:none; }
.plan-room { position:absolute; display:grid; align-content:center; min-width:0; padding:0 1px; border:1px solid transparent; background:transparent; color:#432f27; font-weight:750; }
.plan-room:hover, .plan-room:focus-visible { background:#fff8e59e; border-color:#a04a31; }
.plan-room[aria-current] { border-color:#953f29; background:#a9503617; }
.plan-room-label { display:block; padding:2px; transform:translateY(-50%); color:#352923; font-size:clamp(8px,1.5cqw,10px); line-height:1.1; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; overflow-wrap:anywhere; text-shadow:0 1px #fff7e9; }
.plan-legend { display:flex; justify-content:space-between; align-items:center; gap:3px; margin-top:7px; font-size:10px; color:#5e5146; }
.plan-legend b { color:#913f2b; }
.tour-position { position:absolute; left:17px; bottom:16px; display:grid; grid-template-columns:auto auto; column-gap:12px; align-items:end; padding:8px 11px; background:#28211be8; color:#fff3e3; border-radius:4px; }
.tour-location { grid-column:1/-1; color:#dfc5ab; font-size:10px; }
.tour-room { font-size:16px; }
.tour-count { color:#dfc9b5; font-size:11px; font-variant-numeric:tabular-nums; }
.tour-actions { position:absolute; left:50%; bottom:16px; display:flex; gap:8px; transform:translateX(-50%); }
.tour-step { display:flex; justify-content:center; align-items:center; gap:8px; min-width:84px; padding:9px 11px; border:1px solid #7e6653; border-radius:4px; background:#fff8ed; color:#372a21; font-size:13px; font-weight:750; white-space:nowrap; }
.tour-step.next { background:#903f28; color:#fff5e9; border-color:#a5593e; }
.tour-step:hover:enabled { filter:brightness(1.12); }
.tour-step:disabled { opacity:.7; }
.tour-guide { display:flex; justify-content:space-between; align-items:start; gap:10px; padding:11px 1px; border-bottom:1px solid var(--line); font-size:12px; color:var(--muted); }
.tour-guide p { display:flex; flex-wrap:wrap; gap:5px 16px; }
.tour-directory { text-align:right; min-width:100px; }
.tour-directory summary { cursor:pointer; }
.tour-work-list { display:flex; flex-wrap:wrap; gap:2px 12px; justify-content:flex-end; margin-top:6px; }
.intro-reading { padding:clamp(20px,4vw,38px); }
.intro-reading h2 { margin:6px 0 24px; }
.intro-reading p:last-child { white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.95; }
@media(max-width:680px) {
  .tour-head { margin:14px 0 9px; }
  .tour-stage { height:clamp(455px,71svh,610px); }
  .tour-map { top:8px; right:8px; width:43%; padding:6px; }
  .plan-legend { font-size:9px; }
  .plan-legend span:last-child { display:none; }
  .tour-position { left:8px; bottom:10px; padding:6px 8px; column-gap:6px; }
  .tour-room { font-size:14px; }
  .tour-actions { left:auto; right:8px; bottom:10px; transform:none; gap:5px; }
  .tour-step { min-width:61px; padding:7px 5px; gap:4px; font-size:12px; }
  .tour-key-guide { display:none; }
}

.catalog { padding-bottom: 22px; }
.catalog-heading { padding: clamp(25px, 4vw, 57px) 0 24px; border-bottom: 1px solid var(--line); }
.catalog-heading h1 { margin: 4px 0 0; font: 750 clamp(33px, 5vw, 61px)/1.12 "Songti SC", "Noto Serif SC", serif; }
.catalog-notice { margin-top: 21px; color: var(--muted); }
.catalog-section { margin-top: clamp(21px, 3vw, 34px); }
.catalog-section-heading { display: flex; justify-content: space-between; gap: 14px; align-items: baseline; margin-bottom: 12px; }
.catalog-section-heading h2 { font: 740 clamp(20px, 2.6vw, 31px)/1.2 "Songti SC", "Noto Serif SC", serif; }
.catalog-section-heading > span { font-size: 12px; color: var(--muted); }
.gallery-list { display: grid; gap: 13px; }
.gallery-card { overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr); border: 1px solid #d6ccbd; background: var(--surface); border-radius: 5px; }
.gallery-cover { overflow: hidden; min-height: 248px; background: #ded0be; position: relative; }
.gallery-cover img { display: block; width: 100%; height: 100%; position: absolute; object-fit: cover; object-position: 68% 53%; }
.gallery-card-body { padding: clamp(18px, 3vw, 38px); overflow-wrap: anywhere; }
.gallery-status { display: inline-flex; align-items: center; gap: 6px; color: #53614e; font-size: 12px; font-weight: 700; }
.gallery-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.gallery-status.upcoming { color: #8b5527; }
.gallery-card h3 { margin: 8px 0 9px; font: 730 clamp(25px, 3.5vw, 43px)/1.15 "Songti SC", "Noto Serif SC", serif; }
.gallery-description { color: #605849; font-size: 14px; line-height: 1.6; margin-bottom: 12px; }
.gallery-meta { display: flex; flex-wrap: wrap; gap: 8px 12px; color: #6b6054; font-size: 12px; }
.gallery-meta span + span { border-left: 1px solid var(--line); padding-left: 12px; }
.gallery-hours { font-size: 12px; color: #675d50; margin-top: 5px; }
.gallery-enter { margin-top: 15px; }
.catalog-empty { background: #f9f6ef; border: 1px dashed #d7cdbf; border-radius: 4px; padding: 20px; font-size: 14px; color: var(--muted); }
@media(max-width: 620px) {
  .gallery-card { grid-template-columns: minmax(0,1fr); }
  .gallery-cover { min-height: auto; aspect-ratio: 2.2; }
}

.gallery-chooser { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 7px; font-size: 12px; color: var(--muted); }
.gallery-chooser select { max-width: min(39vw, 230px); padding: 7px 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 4px; color: var(--ink); font-weight: 650; }
.route-tabs .catalog-settings-tab { margin-right: 6px; border-right: 1px solid #bda891; }
.route-tabs .catalog-settings-tab:not([aria-pressed=true]) { background: #f1e3d3; color: #663924; }
.card-preview .gallery-cover { min-height: 190px; }
.wall-visual { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.intro.wall-caption { padding: 12px 13px; border-radius: 4px; background: #fcf1dfeb; }
.stage:is(.wall,.stand)[style*="--chosen-wall"] { --light: var(--chosen-wall); --shade: color-mix(in srgb, var(--chosen-wall), #706457 21%); --side: color-mix(in srgb, var(--chosen-wall), #66594a 37%); }
.frame .art-image { box-shadow: inset 0 0 0 clamp(3px,.48cqw,8px) var(--frame-ink,#50372c), inset 0 0 0 clamp(5px,.8cqw,11px) #cfb391, 4px 9px 12px #3b2a2250; }
.frame[data-frame=slim] .art-image { padding: 3%; box-shadow: inset 0 0 0 clamp(2px,.32cqw,5px) var(--frame-ink), 4px 7px 11px #3b2a2250; }
.frame[data-frame=double] .art-image { padding: 8%; box-shadow: inset 0 0 0 3px var(--frame-ink), inset 0 0 0 6px #eee1cc, inset 0 0 0 9px var(--frame-ink), 4px 9px 12px #3b2a2250; }
.frame[data-frame=rounded] .art-image { border-radius: 11% / 18%; }
.frame[data-frame=frameless] .art-image { padding: 0; box-shadow: 2px 5px 8px #3b2a2238; }
@media(max-width: 740px) {
  .editor-tools:has(.gallery-chooser) { flex-wrap: wrap; justify-content: flex-end; }
  .gallery-chooser { flex-basis: 100%; justify-content: flex-end; }
  .card-preview .gallery-cover { min-height: 120px; }
}

@media(max-width: 740px) {
  .section-top:has(.gallery-chooser) { align-items: flex-start; flex-direction: column; }
  .editor-tools:has(.gallery-chooser), .gallery-chooser { justify-content: flex-start; }
}

.map-room-legend { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px; margin:8px 0 0; max-height:22vh; overflow:auto; }
.map-room-legend button { display:flex; gap:5px; align-items:center; text-align:left; font-size:10px; padding:3px 4px; border:1px solid transparent; color:#493a2f; background:transparent; border-radius:3px; }
.map-room-legend button::before { content:''; width:10px; height:10px; border-radius:2px; flex:none; border:1px solid #817268; background:var(--room-swatch); }
.map-room-legend button[aria-current], .map-room-legend button:hover { border-color:#b27d65; background:#efdfcd; }
.surface-view { border:1px solid var(--line); border-radius:5px; overflow:hidden; }
.surface-banner { display:flex; justify-content:space-between; align-items:center; padding:8px 12px; background:#f5efe5; font-size:13px; border-bottom:1px solid var(--line); }
.surface-banner span, .surface-note { color:var(--muted); font-size:11px; }
.surface-note { margin:0; padding:8px 12px; }
.surface-plane { background:var(--surface-tone); position:relative; width:100%; min-width:0; overflow:hidden; touch-action:none; }
.ground-plane { background-color:#cbb99c; background-image:linear-gradient(#f7ebd163 1px,transparent 1px),linear-gradient(90deg,#f7ebd163 1px,transparent 1px); background-size:10% 10%; }
.surface-slot, .surface-door, .surface-art, .surface-sign { position:absolute; translate:-50% -50%; }
.surface-door { display:grid; place-items:center; background:#68584e; color:#fff1d9; border:2px dashed #f0e0c7; font-size:12px; }
.floor-threshold { position:absolute; background:#806c53; border:1px dashed #faeee0; }
.floor-threshold:is(.north,.south) { width:28.64%; height:4%; left:35.68%; }
.floor-threshold:is(.east,.west) { height:33.16%; width:4%; top:33.42%; }
.floor-threshold.north { top:0; }.floor-threshold.south { bottom:0; }.floor-threshold.east { right:0; }.floor-threshold.west { left:0; }
.surface-sign { display:flex; flex-direction:column; align-items:center; justify-content:center; padding:2px; text-overflow:ellipsis; overflow:hidden; color:#443329; line-height:1.1; background:#f6eee1; container-type:inline-size; }
.surface-sign strong { font-size:7cqw; white-space:nowrap; }
.surface-sign span { font-size:5.15cqw; white-space:nowrap; }
.surface-slot { color:#6d5749; border:0; padding:0; cursor:grab; background:#f6efe0; box-shadow:inset 0 0 0 5px var(--frame-ink), 1px 5px 10px #34261939; }
.surface-slot[data-frame=slim] { box-shadow:inset 0 0 0 2px var(--frame-ink), 1px 4px 8px #34261935; }
.surface-slot[data-frame=double] { box-shadow:inset 0 0 0 3px var(--frame-ink),inset 0 0 0 5px #eadcc9,inset 0 0 0 7px var(--frame-ink),1px 4px 8px #34261935; }
.surface-slot[data-frame=rounded] { border-radius:12%; }
.surface-slot[data-frame=frameless] { box-shadow:1px 4px 8px #34261930; }
.surface-slot[data-frame=stand] { box-shadow:inset 0 0 0 2px #95806b,3px 6px 9px #38271047; background:#e5d2b6; }
.surface-slot.is-selected { outline:2px solid #973d27; outline-offset:3px; z-index:4; }
.surface-art { background:#ded2ba; display:grid; place-items:center; }
.surface-art img { width:100%; height:100%; min-height:0; min-width:0; object-fit:contain; pointer-events:none; }
.surface-empty { font-size:15px; line-height:1; pointer-events:none; }
.surface-slot-number { position:absolute; top:100%; right:0; color:#4b3b30; background:#f7eee0; padding:0 5px; font-size:9px; pointer-events:none; }
.surface-resize { position:absolute; width:12px; height:12px; right:0; bottom:0; border:1px solid white; background:#973d27; cursor:nwse-resize; }
.art-resize { background:#2f615d; right:-2px; bottom:-2px; }
.layout-grid { display:grid; grid-template-columns:repeat(var(--layout-cols),minmax(0,1fr)); gap:4px; padding:10px; border:1px solid var(--line); background:#eee5d9; }
.layout-cell { min-height:32px; border:1px dashed #afa294; color:var(--muted); background:var(--cell-tone); padding:3px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; text-align:center; }
.layout-cell.filled { border-style:solid; color:#49362b; }
.layout-cell.layout-current { outline:2px solid #a0442c; }
.layout-cell small { display:block; }
.layout-warning { font-size:12px; color:#933e2b; margin:8px 0; }
.layout-diagram { width:min(410px,100%); margin:12px auto 0; }
.layout-diagram .plan-room { pointer-events:none; }
.surface-tools, .record-actions { display:flex; gap:7px; flex-wrap:wrap; align-items:center; }
.surface-tools strong { font-size:13px; }
.coordinates .number-pair { display:grid; grid-template-columns:minmax(0,1fr) 65px; gap:6px; align-items:center; }
.editor-extra { border-top:1px solid var(--line); padding-top:12px; margin-top:14px; }
.editor-extra h3 { margin:0 0 8px; }
.stats-pane { padding:18px; border:1px solid var(--line); border-radius:5px; background:var(--surface); }
.stats-pane table { border-collapse:collapse; width:100%; margin:8px 0 20px; font-size:13px; }
.stats-pane th,.stats-pane td { text-align:left; padding:6px; border-bottom:1px solid var(--line); }
.stats-pane th:last-child,.stats-pane td:last-child { text-align:right; }
.stats-total { color:var(--accent); font-size:29px; font-weight:740; margin-bottom:8px; }
.detail-actions { display:flex; padding:12px 16px; border-top:1px solid var(--line); }
.like-button { color:#8d3c35; font-size:17px; }
.like-button[aria-pressed=true] { color:#ad263b; background:#fce7e6; border-color:#d3a09c; }
.preview-status { padding:8px 12px; border:1px solid #dcc8b7; border-radius:4px; margin:10px 0; color:#793b29; background:#f5e6d5; font-size:12px; }
.ground-plane { width:min(100%, calc(58vh * var(--surface-ratio, 1.16))); margin-inline:auto; }
@media(min-width: 850px) { .editor-main:has(.surface-view) { position:sticky; top:10px; align-self:start; } }

.surface-plane { touch-action:pan-y pinch-zoom; }
.surface-slot, .board-editor, .surface-desk { touch-action:none; }
.surface-wall-photo { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; pointer-events:none; }
.surface-sign.board-editor { display:block; border:0; padding:0; background:transparent; overflow:visible; cursor:grab; }
.board-editor canvas { display:block; width:100%; height:100%; pointer-events:none; }
.board-editor.is-selected,.surface-desk.is-selected { outline:2px solid #973d27; outline-offset:3px; z-index:5; }
.surface-mode-switch { display:flex; gap:7px; flex-wrap:wrap; margin-bottom:10px; }
.surface-mode-switch button[aria-pressed=true] { background:#9c452e; color:#fff; border-color:#9c452e; }
.surface-desk { position:absolute; translate:-50% -50%; background:#876447; border:1px solid #67452e; box-shadow:3px 5px 9px #39261650; border-radius:3px; padding:0; min-width:0; color:#fff5e1; font-size:clamp(8px,1.1vw,13px); cursor:grab; white-space:nowrap; }
.board-swatches { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.board-swatches button { width:26px; height:26px; border:1px solid #8e8174; border-radius:4px; background:var(--swatch); padding:0; }
.board-swatches button[aria-pressed=true] { outline:2px solid #9b452c; outline-offset:1px; }
.board-swatches input[type=color] { width:44px; height:30px; padding:2px; border:1px solid var(--line); }
.text-field { margin-bottom:14px; }
.text-field > .field { margin-bottom:4px; }
.text-format { display:grid; grid-template-columns:minmax(0, 1.35fr) minmax(0, 1fr) 38px; gap:5px; }
.text-format :is(select,input) { min-width:0; width:100%; height:33px; padding:4px 5px; border:1px solid var(--line); border-radius:3px; background:#fbf9f4; color:var(--ink); font:inherit; font-size:12px; }
.text-format input { padding:2px; cursor:pointer; }
.guest-form textarea { width:100%; resize:vertical; min-height:7rem; font-size:16px; }
.guest-form .guest-counter { display:block; text-align:right; color:var(--muted); font-size:12px; }
.guest-form .guest-counter.over-limit { color:#9a352c; }
.tour-feedback { position:absolute; z-index:5; bottom:62px; right:14px; }
.tour-feedback[hidden] { display:none; }
.message-panel { margin-top:18px; border-top:1px solid var(--line); padding-top:15px; }
.message-panel-head,.message-pages { display:flex; gap:8px; justify-content:space-between; align-items:center; }
.message-panel-head span,.message-pages span { color:var(--muted); font-size:13px; }
.message-list { list-style:none; margin:8px 0 12px; padding:0; }
.message-list button { display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; min-height:39px; padding:7px 4px; border:0; border-bottom:1px solid var(--line); background:transparent; color:var(--ink); text-align:left; }
.message-list button:hover { background:#f2e8dc; }
.message-list button span:first-child { min-width:0; max-width:min(100%,32em); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.message-full { padding:18px; }
.message-full p { white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.7; }
.message-full time { display:block; text-align:right; margin-top:16px; font-size:12px; color:var(--muted); }
.mobile-drive,.touch-tour-hint { display:none; }
@media(max-width:760px),(pointer:coarse) {
  .mobile-drive { display:flex; position:absolute; left:12px; bottom:64px; z-index:6; gap:6px; touch-action:none; }
  .mobile-drive button { min-width:44px; height:44px; padding:0; border:1px solid #b6a68f; border-radius:5px; background:#28221ded; color:#fff3e4; font-size:23px; font-weight:650; touch-action:none; user-select:none; }
  .mobile-drive button[data-held] { background:#a8472e; border-color:#f2d0a9; }
  .touch-tour-hint { display:block; }
  .portrait-tip { display:none; }
  .surface-resize { width:18px; height:18px; }
  .tour-feedback { bottom:119px; }
  .tour-map[open] { max-height:calc(100% - 112px); overflow-y:auto; }
  .tour-directory { max-width:48%; }
  .field :is(input,textarea,select),.gallery-chooser select { font-size:16px; }
  .text-format :is(select,input) { height:40px; font-size:16px; }
  .board-swatches button { width:32px; height:32px; }
}
@media(max-width:760px) and (orientation:portrait) {
  .portrait-tip { display:inline; margin-left:.25em; }
  .tour-stage { height:clamp(425px,68svh,670px); }
  .coordinates:has(.number-pair) { gap:5px 9px; }
  .coordinates .number-pair { grid-template-columns:minmax(0,1fr) 63px; }
}
@media(max-height:600px) and (orientation:landscape) and (pointer:coarse) {
  .has-tour .top { height:44px; }
  .has-tour .tour-head { margin:5px 0 4px; }
  .has-tour .tour-head h2 { font-size:20px; }
  .has-tour .tour-head .eyebrow { display:none; }
  .tour-stage { height:max(225px,calc(100dvh - 94px)); }
  .mobile-drive { bottom:70px; }
  .tour-feedback { bottom:63px; }
  .tour-map { top:6px; right:6px; }
  .preview-tour { height:calc(100dvh - 66px); }
}

.mobile-editor-jump { display:none; }
@media(max-width:760px),(max-width:960px) and (pointer:coarse) {
  .mobile-editor-jump { display:inline-flex; }
  .editor-main > .mobile-editor-jump { margin-top:8px; }
  .inspector > .mobile-editor-jump { margin-bottom:11px; }
}

.board-editor.classic-wood-frame::before { content:''; position:absolute; inset:calc(-1 * var(--panel-y)) calc(-1 * var(--panel-x)); background:#50372c; box-shadow:2px 4px 7px #3b291e44; pointer-events:none; }
.board-editor.classic-wood-frame canvas { position:relative; }
