/* Phase 7. Scoped styles keep the library, reader and practice tools intact. */
.space-page{max-width:1060px;margin:0 auto;color:var(--ink)}
.space-page-head{display:flex;gap:12px;align-items:center;margin-bottom:20px}.space-page-head>div{flex:1;min-width:0}.space-page-head h1{font-family:Library,system-ui,sans-serif;font-size:26px;line-height:1.3;margin:0}.space-page-head p{font-size:14px;color:var(--muted);margin:6px 0 0}.space-page-head>.icon{flex:none;min-width:44px;font-size:32px;background:transparent;border:0;padding:0}.temple-region-label{max-width:140px}.temple-region-label select{width:100%;padding:8px 12px;background:var(--surface);border:1px solid var(--line);border-radius:12px;min-height:44px}
.space-search{display:flex;align-items:center;gap:10px;border:1px solid var(--line);border-radius:14px;background:var(--surface);padding:0 12px;min-height:50px}.space-search>svg{width:21px;height:21px;flex:none;color:var(--muted)}.space-search input{border:0;background:transparent;min-width:0;width:100%;padding:12px 0;font-size:16px;outline-offset:2px}.space-search button{border:0;padding:0;width:40px;font-size:25px;flex:none}.space-count{font-size:14px;color:var(--muted);margin:14px 0}.space-note{font-size:13px;line-height:1.7;color:var(--muted);margin:22px 0}.space-empty{grid-column:1/-1;text-align:center;padding:32px 16px}.space-page svg,.temple-dialog svg{width:20px;height:20px;flex:none;vertical-align:middle}
.temple-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px}.temple-card{overflow:hidden;background:var(--surface);border:1px solid var(--line);border-radius:18px;text-decoration:none;color:var(--ink);box-shadow:0 4px 15px #5f481008;min-width:0;transition:box-shadow .15s}.temple-card:hover{box-shadow:0 5px 20px #5f481020}.temple-card-photo{position:relative;aspect-ratio:4/3;background:#e9e6df}.temple-card-photo img{width:100%;height:100%;object-fit:cover;display:block}.temple-region{display:inline-block;font-size:12px;font-weight:700;background:#fff4ce;color:#79530e;padding:4px 10px;border-radius:20px}.temple-card-photo .temple-region{position:absolute;right:9px;top:9px;box-shadow:0 1px 4px #0002}.temple-card-copy{padding:14px}.temple-card h2{font:700 18px/1.45 Library,system-ui,sans-serif;margin:0 0 7px;overflow-wrap:anywhere}.temple-card p{font-size:14px;line-height:1.55;color:var(--muted);margin:0 0 7px;display:flex;align-items:flex-start;gap:5px}.temple-card p svg{width:16px;height:20px}.temple-card small{font-size:12px;line-height:1.5;color:var(--muted);display:block}
#dialog.temple-dialog{width:760px;max-width:calc(100vw - 24px);height:calc(100dvh - 40px);max-height:calc(100dvh - 40px);border:0;border-radius:24px;overscroll-behavior:contain;background:var(--bg);scrollbar-width:thin}
#dialog.temple-dialog>header{padding:8px 12px 8px 20px;min-height:56px;background:var(--surface);border-bottom:0;z-index:3}#dialog.temple-dialog>header h2{font:700 16px/1.4 Library,system-ui,sans-serif;max-width:calc(100% - 54px)}#dialog.temple-dialog>header button{width:44px;height:44px;font-size:29px;flex:none}#dialog.temple-dialog .dialog-body{padding:0}.temple-hero{position:relative;background:#eae6db}.temple-carousel{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;scrollbar-width:none;overscroll-behavior-x:contain}.temple-carousel::-webkit-scrollbar{display:none}.temple-slide{flex:0 0 100%;scroll-snap-align:start;aspect-ratio:4/3;display:block;min-width:0;background:#e9e5da}.temple-slide img{width:100%;height:100%;object-fit:contain;display:block}.photo-prev,.photo-next{position:absolute;top:45%;width:42px;height:42px;min-height:42px;font-size:29px;border:0;border-radius:50%;background:#fffdf3ed;color:#523c1c;padding:0}.photo-prev{left:10px}.photo-next{right:10px}.photo-dots{position:absolute;bottom:12px;left:50%;transform:translateX(-50%);display:flex;gap:0;background:#0005;border-radius:22px}.photo-dots button{width:30px;min-height:30px;padding:0;border:0;background:transparent}.photo-dots button:after{content:'';width:7px;height:7px;border-radius:50%;background:#ffffff88}.photo-dots button[aria-pressed=true]:after{background:#fff}
.temple-detail-body{padding:24px}.temple-title{margin-bottom:24px}.temple-title h1{font:700 28px/1.35 Library,system-ui,sans-serif;margin:10px 0 6px}.temple-title p{margin:4px 0;color:var(--muted);font-size:15px}.temple-place{display:flex;gap:6px;align-items:center}.temple-section{background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:23px;margin-bottom:16px;font-size:17px;line-height:1.85;overflow-wrap:anywhere;user-select:text;-webkit-user-select:text}.temple-section h2{font:700 19px/1.5 Library,system-ui,sans-serif;margin:0 0 12px;color:var(--ink)}.temple-section p{margin:0 0 12px}.temple-section p:last-child{margin-bottom:0}.temple-section ul{margin:0;padding-left:22px}.temple-section li{padding:4px 0}.temple-facts{margin:0}.temple-facts>div{display:grid;grid-template-columns:115px minmax(0,1fr);gap:14px;padding:13px 0;border-top:1px solid var(--line)}.temple-facts>div:first-child{border-top:0;padding-top:0}.temple-facts dt{color:var(--muted);font-size:14px}.temple-facts dd{margin:0;font-size:15px;line-height:1.75}.temple-visit{font-size:15px;border-top:1px solid var(--line);padding-top:14px;color:var(--ink)}.temple-sources{font-size:13px;line-height:1.8;padding:10px 4px;color:var(--muted)}.temple-sources summary{cursor:pointer;min-height:44px;display:list-item;padding:10px 0;font-size:14px}.temple-sources ul{padding-left:20px}.temple-sources a{overflow-wrap:anywhere}.temple-sources .fine{font-size:12px}.temple-detail-actions{display:flex;gap:10px;margin-top:14px}.temple-detail-actions>.primary{flex:1;background:#bd8b30;color:#fff;border-color:#bd8b30;font-size:16px;font-weight:700;min-height:50px}.temple-detail-actions>button{font-size:14px}
.space-scenes{margin:24px 0 35px}.space-scenes p{color:var(--muted);font-size:15px}.space-scene-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.space-scene{display:flex;flex-direction:column;align-items:stretch;gap:0;border-radius:15px;overflow:hidden;padding:0;text-align:left;min-width:0;border:2px solid var(--line)}.space-scene img{width:100%;aspect-ratio:4/3;object-fit:cover;display:block}.space-scene span{font-weight:700;font-size:15px;padding:10px 10px 3px}.space-scene small{font-size:12px;padding:0 10px 10px;color:var(--muted)}.space-scene[aria-pressed=true]{border-color:var(--gold);box-shadow:0 0 0 2px var(--gold)}.space-filter-chips{display:flex;gap:8px;flex-wrap:wrap;margin:18px 0}.space-filter-chips button[aria-pressed=true]{background:#f4d685;color:#503810;border-color:#c6a454}.space-gallery{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.space-image-card{min-width:0;border:1px solid var(--line);border-radius:16px;background:var(--surface);overflow:hidden}.space-image-open{display:block;border:0;background:#e9e5da;padding:0;border-radius:0;width:100%}.space-image-open img{display:block;width:100%;height:220px;object-fit:contain}.space-image-card>div{padding:14px}.space-image-card h3{font:700 16px/1.5 Library,system-ui,sans-serif;margin:0 0 10px}.space-image-card .actions{gap:6px}.space-image-card .actions button{font-size:13px;padding:8px}.space-full-image{display:block;max-height:60dvh;width:100%;object-fit:contain;background:#eee9df}.space-image-dialog p{line-height:1.8;overflow-wrap:anywhere}.meditation-focus.scene-photo{background-image:linear-gradient(180deg,#0c171d55,#0c171d25 40%,#0c171d88),var(--scene-image)!important;background-size:cover;background-position:center}.scene-options{max-height:60dvh;overflow-y:auto}.scene-options button img{object-fit:cover}.scene-options button span{line-height:1.4}
body.dark .temple-hero,body.dark .temple-slide,body.dark .space-full-image,body.dark .space-image-open{background:#18251f}body.dark .temple-region{background:#644e20;color:#fff1bd}body.dark .space-filter-chips button[aria-pressed=true]{color:#30220b}
@media(max-width:800px){.temple-grid,.space-gallery{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.space-page-head h1{font-size:23px}.space-page-head{gap:8px}.space-page-head p{font-size:12px}.temple-region-label{max-width:112px}.temple-region-label select{font-size:14px;padding:8px}.temple-card-copy{padding:11px}.temple-card h2{font-size:16px}.temple-card p{font-size:12px}.temple-card small{font-size:11px}.temple-region{font-size:10px;padding:3px 8px}.temple-card-photo .temple-region{top:7px;right:7px}.temple-detail-body{padding:16px}.temple-section{padding:19px}.temple-section h2{font-size:18px}.temple-title h1{font-size:25px}.space-image-open img{height:175px}.space-image-card>div{padding:11px}.space-image-card h3{font-size:14px}.space-scene span{font-size:13px}.space-scene small{font-size:10px}.space-image-card .actions button{font-size:12px;padding:6px}#dialog.temple-dialog{margin:auto 0 0;width:100%;max-width:100%;height:calc(100dvh - max(12px,env(safe-area-inset-top)));max-height:calc(100dvh - max(12px,env(safe-area-inset-top)));border-radius:22px 22px 0 0}.temple-detail-body{padding-bottom:calc(20px + env(safe-area-inset-bottom))}.temple-facts>div{grid-template-columns:90px minmax(0,1fr);gap:10px}.temple-facts dd{font-size:14px}.temple-facts dt{font-size:13px}.temple-section{font-size:16px;line-height:1.85}}
@media(max-width:360px){.space-page-head h1{font-size:20px}.space-page-head p{display:none}.space-page-head>.icon{min-width:32px}.temple-region-label{max-width:95px}.temple-card h2{font-size:14px}.temple-card-copy{padding:10px}.temple-section{padding:16px}.temple-detail-body{padding:12px}.temple-facts>div{grid-template-columns:1fr;gap:4px}.space-scene-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.space-image-open img{height:140px}.temple-detail-actions{flex-wrap:wrap}.temple-detail-actions>.primary{min-width:100%}}
@media(prefers-reduced-motion:reduce){.temple-card{transition:none}.temple-carousel{scroll-behavior:auto}}

body:not(.dark)[data-route="temples"],body:not(.dark)[data-route="temple"],body:not(.dark)[data-route="gallery"]{--bg:#faf7ef;--surface:#fffdf8;background:var(--bg)}
.space-page-head>.icon{text-decoration:none}.space-page .space-search input{border:0!important;box-shadow:none!important;background:transparent!important;outline:0}.space-search:focus-within{outline:2px solid var(--gold);outline-offset:2px}
