/* Planetary Orbital Mandala (js/mandala/view.js). Everything is scoped under .om so it can sit on any page of the site. */
.om { --om-gold: #c9a84c; --om-gold-hi: #f1d88a; --om-ink: #e9dfc4; --om-dim: #a99f87; --om-bg: #09090f; --om-line: rgba(201, 168, 76, 0.32);
    display: grid; grid-template-columns: minmax(0, 1fr) 330px; grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "cap panel" "stage panel";
    gap: 10px 18px; position: relative; background: var(--om-bg); color: var(--om-ink); border: 1px solid var(--om-line); border-radius: 14px; padding: 14px;
    font: 14px/1.45 "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif; text-align: left; }
.om *, .om *::before, .om *::after { box-sizing: border-box; }
.om [hidden] { display: none !important; }
.om-caption { grid-area: cap; text-align: center; }
.om .om-title { color: var(--om-gold); font-size: 1.5rem; letter-spacing: 0.06em; line-height: 1.25; }
.om .om-sub { color: var(--om-dim); font-size: 0.82rem; }
.om .om-note { color: var(--om-dim); font-size: 0.75rem; font-style: italic; }
.om-stage { grid-area: stage; display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 280px; height: min(74vh, 760px); overflow: hidden; }
.om-frame { position: relative; flex: none; }
.om .om-frame canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.om-panel { grid-area: panel; display: flex; flex-direction: column; gap: 10px; max-height: calc(min(74vh, 760px) + 70px); overflow-y: auto; padding-right: 4px; min-width: 0;
    scrollbar-width: thin; scrollbar-color: rgba(201, 168, 76, 0.5) transparent; }

/* controls: fine brass on the void; the page's own big gold buttons are switched off here */
.om button, .om select { font: inherit; font-size: 0.84rem; letter-spacing: 0.02em; text-transform: none; text-shadow: none; margin: 0; width: auto; min-width: 0; min-height: 0;
    color: var(--om-ink); background: rgba(201, 168, 76, 0.07); border: 1px solid var(--om-line); border-radius: 7px; padding: 6px 10px; box-shadow: none; cursor: pointer; line-height: 1.3; }
.om button:hover, .om select:hover { transform: none; filter: none; border-color: var(--om-gold); box-shadow: none; background: rgba(201, 168, 76, 0.14); color: var(--om-ink); }
.om button:focus-visible, .om select:focus-visible, .om input:focus-visible, .om summary:focus-visible { outline: 2px solid var(--om-gold-hi); outline-offset: 1px; }
.om select { background: #14131c; padding: 5px 8px; max-width: 100%; }
.om button.on { border-color: var(--om-gold-hi); color: var(--om-gold-hi); background: rgba(201, 168, 76, 0.22); }
.om button.om-main { background: linear-gradient(#f1d88a, #a98a34); color: #171204; border: 0; font-weight: bold; }
.om button.om-main:hover { color: #171204; background: linear-gradient(#ffe9a6, #bb993c); }
.om fieldset { border: 1px solid var(--om-line); border-radius: 10px; padding: 6px 10px 10px; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.om legend { color: var(--om-gold); font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; padding: 0 6px; }
.om label { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 0.82rem; color: var(--om-ink); }
.om input[type="checkbox"] { width: auto; margin: 0; accent-color: var(--om-gold); }
.om input[type="color"] { width: 40px; height: 30px; padding: 2px; margin: 0; border: 1px solid var(--om-line); border-radius: 7px; background: #14131c; cursor: pointer; }
.om-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.om-transport { display: grid; grid-template-columns: 1fr auto; gap: 6px 8px; }
.om-progress { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: rgba(201, 168, 76, 0.18); overflow: hidden; }
.om-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #a98a34, #f1d88a); }
.om-readout { grid-column: 1 / -1; color: var(--om-dim); font-size: 0.76rem; font-variant-numeric: tabular-nums; }
.om-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.om .om-presets button { display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 1px; }
.om .om-presets b { font-weight: normal; color: var(--om-gold-hi); font-size: 0.86rem; }
.om .om-presets span { color: var(--om-dim); font-size: 0.7rem; }
.om-seg { display: flex; gap: 4px; flex-wrap: wrap; }
.om .om-seg button { flex: 1 1 auto; }
.om-matrix { border: 1px solid var(--om-line); border-radius: 10px; padding: 0 10px; margin: 0; }
.om .om-matrix summary { cursor: pointer; padding: 8px 0; color: var(--om-gold); font-size: 0.86rem; }
.om .om-matrix[open] { padding-bottom: 10px; }
.om .om-hint { margin: 0 0 6px; color: var(--om-dim); font-size: 0.74rem; }
.om table { width: 100%; border-collapse: collapse; table-layout: fixed; margin: 0 0 8px; }
.om th, .om td { padding: 1px; text-align: center; color: var(--om-gold); font-weight: normal; font-size: 1rem; border: 0; background: none; }
.om .om-ab { font-size: 0.62rem; color: var(--om-dim); }
.om td button { display: block; width: 100%; aspect-ratio: 1; padding: 0; border-radius: 4px; }
.om td button.on { background: var(--om-gold); box-shadow: 0 0 10px rgba(241, 216, 138, 0.8); }
.om td.om-same { background: repeating-linear-gradient(45deg, transparent 0 3px, rgba(201, 168, 76, 0.18) 3px 4px); }
.om-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* a see-through centrepiece (over the altar in a Spiritual Space) */
.om.om-transparent { background: transparent; border-color: transparent; }

/* ambient mode: the weave alone */
.om.om-ambient { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); grid-template-areas: "stage"; border-color: transparent; }
.om.om-ambient .om-panel, .om.om-ambient .om-caption { display: none; }
.om button.om-show { display: none; position: absolute; right: 12px; bottom: 12px; z-index: 3; background: rgba(9, 9, 15, 0.85); transition: opacity 0.6s; }
.om.om-ambient button.om-show { display: block; opacity: 0; }
.om.om-ambient.om-awake button.om-show, .om.om-ambient button.om-show:focus-visible { opacity: 1; }

/* narrow: the figure first, the controls under it (also inside the room's drawer) */
.om.om-compact { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; grid-template-areas: "cap" "stage" "panel"; border: 0; border-radius: 0; padding: 10px; }
.om.om-compact .om-stage { height: min(52vh, 390px, 90vw); min-height: 220px; }
.om.om-compact .om-panel { max-height: none; overflow: visible; padding: 0; }
.om.om-compact .om-title { font-size: 1.15rem; }
@media (max-width: 860px) {
    .om { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; grid-template-areas: "cap" "stage" "panel"; padding: 10px; }
    .om-stage { height: min(92vw, 68vh); min-height: 240px; }
    .om-panel { max-height: none; overflow: visible; padding: 0; }
    .om .om-title { font-size: 1.2rem; }
}

/* the standalone page's ambient mode fills the window */
.om.om-full { position: fixed; inset: 0; z-index: 1000; border-radius: 0; padding: 0; }
.om.om-full .om-stage { height: 100vh; height: 100dvh; min-height: 0; }

/* ---- in a Spiritual Space (js/mandala/room.js) */
.om-drawer { position: fixed; right: 0; top: calc(var(--nav, 50px) + var(--tiles, 0px)); bottom: var(--rchat-h, 0px); /* the chat and voice bar stays free */ width: min(430px, 100vw); z-index: 29; display: flex; flex-direction: column;
    background: #09090f; border-left: 1px solid rgba(201, 168, 76, 0.5); box-shadow: -18px 0 50px rgba(0, 0, 0, 0.7); }
.om-drawer-head { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid rgba(201, 168, 76, 0.32); }
.om-drawer-head b { margin-right: auto; color: #c9a84c; font: normal 15px Georgia, serif; letter-spacing: 0.08em; }
.om-drawer-body { flex: 1; min-height: 0; overflow-y: auto; }
.om-drawer-hint { margin: 0; padding: 8px 12px 14px; color: #a99f87; font-size: 12px; }
.om-over { position: absolute; z-index: 4; pointer-events: none; }
.om-over::before { content: ''; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, rgba(9, 9, 15, 0.76) 0 42%, rgba(9, 9, 15, 0.34) 57%, transparent 70%); }
.om-over .om { position: absolute; inset: 0; display: block; padding: 0; border: 0; pointer-events: none; }
.om-over .om .om-stage { height: 100%; min-height: 0; }
.om-over .om-panel, .om-over .om-caption, .om-over button.om-show { display: none !important; }
.om-over-chip { position: absolute; left: 12px; top: 10px; z-index: 6; display: flex; gap: 6px; }
.om-open-btn.live { border-color: #f1d88a; box-shadow: 0 0 12px rgba(241, 216, 138, 0.65); }
@media (max-width: 700px) {
    .om-drawer { top: auto; height: 74vh; height: 74dvh; bottom: var(--navfoot, 58px); width: 100%; z-index: 59; border-left: 0; border-top: 1px solid rgba(201, 168, 76, 0.5); border-radius: 16px 16px 0 0; }
}
