:root {
  color-scheme: light;
  --ink: #282c2b;
  --muted: #7e827b;
  --paper: #f6f5ef;
  --line: rgba(58, 63, 55, .13);
  --accent: #cbb349;
  --panel: rgba(249, 249, 244, .91);
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
body { color: var(--ink); background: #e8e7df; -webkit-tap-highlight-color: transparent; }
button, summary { -webkit-user-select: none; user-select: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: transparent; touch-action: manipulation; }
button, a, summary { outline-offset: 4px; }
button:focus-visible, summary:focus-visible { outline: 2px solid #827125; }
button svg { width: 20px; height: 20px; flex-shrink: 0; }
button:hover { color: #000; }
button:disabled { opacity: .45; cursor: default; }
[hidden], .hidden { display: none !important; }
#scene { position: fixed; inset: 0; display: block; width: 100%; height: 100%; outline: none; touch-action: none; }

.topbar { position: fixed; top: max(24px, env(safe-area-inset-top)); inset-inline: max(26px, env(safe-area-inset-left), env(safe-area-inset-right)); display: flex; align-items: center; justify-content: space-between; pointer-events: none; z-index: 4; }
.brand { display: flex; gap: 12px; align-items: center; text-shadow: 0 1px 10px rgba(249, 249, 244, .8); }
.brand-mark { display: block; width: 29px; height: 34px; }
.brand-mark svg { width: 100%; height: 100%; }
.brand h1 { margin: 0; font-size: 23px; font-weight: 600; letter-spacing: -.8px; line-height: 1.1; }
.brand p { margin: 6px 0 0; font-size: 9px; font-weight: 600; letter-spacing: 2px; }
.brand p span { margin: 0 3px; color: #9b945f; }
.top-actions { display: flex; align-items: center; gap: 15px; pointer-events: auto; }
.segmented.lang-switch { gap: 1px; background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(16px); }
.lang-switch button { min-width: 31px; padding: 6px 7px; border-radius: 5px; font-size: 10px; }
.lang-switch button[aria-pressed="true"] { background: #fff; box-shadow: 0 1px 4px rgba(30, 36, 25, .08); }
#status { font-size: 10px; color: #5d655a; padding: 7px 10px; border-radius: 18px; background: rgba(248, 248, 242, .76); backdrop-filter: blur(12px); max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#status.error { color: #963b29; background: #fff0e9; max-width: 360px; }
.quiet-button { display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(16px); border-radius: 8px; padding: 9px 11px; font-size: 11px; }
.quiet-button:hover { background: #fff; }
.notice { position: fixed; bottom: max(17px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); margin: 0; color: #5d635c; font-size: 9px; letter-spacing: .15px; white-space: nowrap; text-shadow: 0 1px 5px var(--paper); z-index: 3; pointer-events: none; }

.explore-dock { position: fixed; top: 109px; inset-inline-start: 26px; width: 188px; border: 1px solid rgba(255, 255, 255, .6); border-radius: 13px; background: var(--panel); box-shadow: 0 5px 30px rgba(32, 38, 26, .06); backdrop-filter: blur(18px); z-index: 4; overflow: hidden; }
.dock-section { padding: 16px 13px 13px; }
.section-label { display: block; font-size: 9px; font-weight: 600; letter-spacing: 1.6px; color: var(--muted); margin-bottom: 11px; }
.segmented { display: flex; padding: 3px; background: rgba(50, 62, 45, .045); border-radius: 7px; gap: 2px; }
.segmented button { flex: 1; border-radius: 5px; font-size: 11px; padding: 7px 5px; white-space: nowrap; }
.segmented button.active, .segmented button[aria-pressed="true"] { background: #fff; box-shadow: 0 1px 4px rgba(30, 36, 25, .08); }
.segmented button:hover { background: rgba(255, 255, 255, .8); }
.room-nav { display: flex; flex-direction: column; padding: 3px 7px 11px; }
.room-button { display: flex; align-items: center; width: 100%; gap: 12px; padding: 10px 11px; border-radius: 6px; text-align: start; font-size: 12px; color: #535b53; }
.room-index { color: #a0a59b; font-size: 9px; width: 15px; letter-spacing: .3px; }
.room-arrow { margin-inline-start: auto; color: #989c91; font-size: 14px; opacity: 0; }
.room-button:hover { background: #eeeee4; }
.room-button:hover .room-arrow { opacity: .75; }
.room-button.active, .room-button[aria-pressed="true"] { background: #e9e7d9; color: #292d27; }
.room-button.active .room-index, .room-button[aria-pressed="true"] .room-index { color: #9a8427; }
.room-button.active .room-arrow, .room-button[aria-pressed="true"] .room-arrow { opacity: 1; }
.style-section { border-top: 1px solid var(--line); padding-top: 13px; }
.material-switch { display: flex; flex-direction: column; gap: 4px; }
.material-switch button { display: flex; align-items: center; gap: 9px; padding: 7px 5px; font-size: 11px; text-align: start; border-radius: 5px; color: #73796f; }
.material-switch button.active, .material-switch button[aria-pressed="true"] { background: #eeeee6; color: var(--ink); }
.material-switch button:hover { background: #eeeee6; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .13); }
.swatch-modern { background: linear-gradient(135deg, #e9e8e4 50%, #3b3f42 50%); }
.swatch-luxury { background: linear-gradient(135deg, #d9cfc0 50%, #b08d4f 50%); }
.swatch-gulf { background: linear-gradient(135deg, #d8c3a0 50%, #1f6b66 50%); }
.furnish-toggle { display: block; width: 100%; margin-top: 8px; padding: 7px 5px; font-size: 11px; border: 1px solid var(--line); border-radius: 5px; color: #73796f; text-align: center; }
.furnish-toggle[aria-pressed="true"] { background: #eeeee6; color: var(--ink); }

.control-bar { position: fixed; left: 50%; bottom: max(43px, calc(env(safe-area-inset-bottom) + 28px)); transform: translateX(-50%); display: flex; align-items: center; gap: 11px; padding: 8px; border-radius: 11px; border: 1px solid rgba(255, 255, 255, .6); background: var(--panel); backdrop-filter: blur(18px); box-shadow: 0 5px 30px rgba(32, 38, 26, .08); z-index: 4; }
.mode-switch { min-width: 117px; }
.mode-switch button { padding: 8px 12px; }
.control-divider { height: 23px; width: 1px; background: var(--line); }
.floor-switch { display: flex; gap: 1px; }
.floor-switch button { font-size: 11px; white-space: nowrap; padding: 9px 10px; border-radius: 5px; color: #7b8274; }
.floor-switch button.active, .floor-switch button[aria-pressed="true"] { color: var(--ink); background: #eae8da; }
.floor-switch button:hover { background: #eae8da; }
.walk-button { display: flex; align-items: center; gap: 18px; padding: 10px 16px; border-radius: 7px; font-size: 11px; font-weight: 600; color: #24261e; background: var(--accent); white-space: nowrap; }
.walk-button:hover { background: #d8c35a; }
.walk-button svg { width: 16px; height: 16px; }

.map-panel { position: fixed; inset-inline-end: 26px; bottom: max(43px, calc(env(safe-area-inset-bottom) + 28px)); width: 143px; padding: 11px 11px 9px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .6); background: rgba(249, 249, 244, .87); backdrop-filter: blur(16px); z-index: 3; box-shadow: 0 5px 30px rgba(32, 38, 26, .05); }
.map-caption { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; color: #7e8376; font-size: 8px; font-weight: 600; letter-spacing: 1.8px; }
.north-label { letter-spacing: 1px; }
#minimap { display: block; width: 100%; height: 138px; border-radius: 3px; }
.map-caption-3d { margin: 8px 0 6px; }
#miniview { display: block; width: 100%; height: 130px; border-radius: 3px; }
.map-coords { display: flex; justify-content: space-between; margin-top: 7px; direction: ltr; font: 600 9px/1 ui-monospace, Consolas, monospace; color: #545c58; letter-spacing: .2px; font-variant-numeric: tabular-nums; }
.help-panel { position: fixed; inset-inline-start: 26px; bottom: max(43px, calc(env(safe-area-inset-bottom) + 28px)); z-index: 5; }
.help-panel summary { display: grid; place-items: center; width: 31px; height: 31px; background: var(--panel); border: 1px solid var(--line); border-radius: 50%; list-style: none; cursor: pointer; font-size: 14px; color: #777d6f; }
.help-panel summary::-webkit-details-marker { display: none; }
.help-content { position: absolute; bottom: 43px; inset-inline-start: 0; width: 214px; padding: 14px 16px; background: rgba(249, 249, 244, .96); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 5px 30px rgba(32, 38, 26, .1); backdrop-filter: blur(20px); }
.help-content p { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 10px; font-size: 11px; }
.help-content p strong { font-weight: 500; color: #6d7567; }
.help-content p span { color: #2d342b; }
.help-content .help-hint { font-size: 10px; display: block; margin: 13px 0 0; padding-top: 10px; border-top: 1px solid var(--line); color: #929789; }
.help-content .touch-help { display: none; }

.reticle { display: none; position: fixed; left: 50%; top: 50%; width: 5px; height: 5px; transform: translate(-50%, -50%); border: 1px solid rgba(255, 255, 255, .9); border-radius: 50%; background: rgba(55, 63, 45, .3); pointer-events: none; z-index: 3; box-shadow: 0 0 0 2px rgba(0, 0, 0, .06); }
body.walking .reticle, body.walk-mode .reticle { display: block; }
.touch-controls, .lookpad { display: none; }

.loading-screen { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: #e9e9e1; transition: opacity .35s; }
.loading-screen.fade-out { opacity: 0; pointer-events: none; }
.loading-card { display: flex; align-items: center; flex-direction: column; color: #828778; }
.loading-card strong { font-size: 24px; color: #32372e; letter-spacing: -.6px; font-weight: 500; margin: 20px 0 7px; }
.loading-card > span:last-child { font-size: 11px; letter-spacing: .5px; }
.loading-symbol { width: 34px; height: 34px; border: 1px solid #d2d4c6; border-top-color: #a39238; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

[dir="rtl"] .room-arrow { transform: scaleX(-1); }
[dir="rtl"] .walk-button svg { transform: scaleX(-1); }
html[lang="ar"] { font-family: "Segoe UI", "Tahoma", "Noto Naskh Arabic", "Noto Sans Arabic", sans-serif; }
html[lang="ar"] * { letter-spacing: 0 !important; }

@media (max-height: 730px) and (min-width: 761px) {
  .explore-dock { top: 95px; }
  .room-button { padding-top: 7px; padding-bottom: 7px; }
  .dock-section { padding-top: 12px; padding-bottom: 10px; }
  .section-label { margin-bottom: 8px; }
}

@media (max-width: 1080px) {
  .control-bar { inset-inline-start: 217px; transform: none; gap: 7px; }
  .floor-switch button { padding-inline: 7px; }
  .walk-button { padding-inline: 12px; gap: 10px; }
  .map-panel { width: 125px; }
  #minimap { height: 124px; }
}

@media (max-width: 860px) and (min-width: 761px) {
  .map-panel { bottom: 117px; }
  .control-bar { left: 50%; transform: translateX(-50%); }
}

@media (max-width: 760px) {
  .topbar { top: max(18px, env(safe-area-inset-top)); inset-inline: max(17px, env(safe-area-inset-left), env(safe-area-inset-right)); }
  .brand { gap: 8px; }
  .brand-mark { width: 24px; height: 29px; }
  .brand h1 { font-size: 20px; }
  .brand p { font-size: 7px; letter-spacing: 1.5px; margin-top: 5px; }
  .top-actions { gap: 7px; }
  #status { max-width: 110px; font-size: 9px; padding: 6px 8px; }
  .quiet-button { padding: 8px; }
  .quiet-button span { display: none; }
  .quiet-button svg { width: 17px; height: 17px; }
  .notice { font-size: 8px; bottom: max(10px, env(safe-area-inset-bottom)); }
  .explore-dock { top: auto; bottom: max(117px, calc(env(safe-area-inset-bottom) + 104px)); inset-inline: 13px; width: auto; border-radius: 10px; overflow: visible; }
  .scope-section { position: absolute; inset-inline-start: 0; top: -46px; width: 159px; padding: 0; }
  .scope-section .section-label { display: none; }
  .preview-switch { background: var(--panel); padding: 4px; border: 1px solid rgba(255, 255, 255, .6); backdrop-filter: blur(18px); box-shadow: 0 3px 16px rgba(32, 38, 26, .05); }
  .preview-switch button { padding: 8px 7px; }
  .room-nav { flex-direction: row; gap: 4px; padding: 7px; overflow-x: auto; scrollbar-width: none; }
  .room-nav::-webkit-scrollbar { display: none; }
  .room-button { flex: 0 0 auto; width: auto; padding: 9px 11px; font-size: 11px; gap: 6px; }
  .room-index { display: none; }
  .room-arrow { display: none; }
  .style-section { position: absolute; inset-inline-end: 0; top: -46px; padding: 0; border: 0; }
  .style-section .section-label { display: none; }
  .material-switch { flex-direction: row; background: var(--panel); padding: 4px; border-radius: 7px; border: 1px solid rgba(255, 255, 255, .6); backdrop-filter: blur(18px); gap: 2px; }
  .material-switch button { gap: 6px; padding: 8px 7px; font-size: 10px; }
  .swatch { width: 11px; height: 11px; }
  .control-bar { bottom: max(33px, calc(env(safe-area-inset-bottom) + 20px)); inset-inline: 13px; transform: none; gap: 6px; flex-wrap: wrap; padding: 7px; border-radius: 10px; }
  .mode-switch { min-width: 96px; }
  .mode-switch button { padding: 7px 10px; font-size: 10px; }
  .control-divider { display: none; }
  .floor-switch { margin-inline-start: auto; }
  .floor-switch button { font-size: 10px; padding: 8px 9px; }
  .walk-button { width: 100%; justify-content: center; padding: 9px 12px; font-size: 11px; }
  .map-panel { inset-inline-end: 17px; bottom: auto; top: 81px; width: 101px; padding: 8px; opacity: .9; }
  #minimap { height: 97px; }
  .map-caption { font-size: 7px; margin-bottom: 5px; }
  .help-panel { inset-inline-start: 17px; bottom: auto; top: 85px; }
  .help-panel summary { width: 27px; height: 27px; font-size: 12px; }
  .help-content { bottom: auto; top: 36px; width: 208px; }
  .help-content .touch-help { display: block; font-size: 10px; color: #8b9283; margin: 8px 0 0; }
}

@media (pointer: coarse) {
  .touch-controls { display: grid; grid-template-columns: repeat(3, 37px); grid-template-rows: repeat(3, 37px); gap: 3px; position: fixed; inset-inline-start: max(17px, env(safe-area-inset-left), env(safe-area-inset-right)); bottom: max(220px, calc(env(safe-area-inset-bottom) + 207px)); z-index: 4; touch-action: none; opacity: .7; }
  .touch-controls button { display: grid; place-items: center; color: #434d3b; font-size: 19px; border: 1px solid rgba(255, 255, 255, .6); background: var(--panel); border-radius: 10px; backdrop-filter: blur(16px); touch-action: none; }
  .touch-controls button:active { background: #d5c678; }
  .touch-up { grid-area: 1 / 2; }
  .touch-left { grid-area: 2 / 1; }
  .touch-center { grid-area: 2 / 2; width: 5px; height: 5px; align-self: center; justify-self: center; border-radius: 50%; background: #869277; }
  .touch-right { grid-area: 2 / 3; }
  .touch-down { grid-area: 3 / 2; }
  .lookpad { display: grid; place-items: center; position: fixed; bottom: max(231px, calc(env(safe-area-inset-bottom) + 218px)); inset-inline-end: max(21px, env(safe-area-inset-left), env(safe-area-inset-right)); width: 88px; height: 88px; border: 1px solid rgba(255, 255, 255, .6); border-radius: 50%; background: rgba(249, 249, 244, .35); backdrop-filter: blur(5px); z-index: 3; touch-action: none; }
  .lookpad span { font-size: 24px; color: #515e48; opacity: .65; pointer-events: none; }
}

@media (max-width: 370px) {
  .scope-section { width: 133px; }
  .preview-switch button { font-size: 10px; padding-inline: 5px; }
  .material-switch button { font-size: 9px; padding-inline: 6px; }
  .material-switch .swatch { display: none; }
  .floor-switch button { padding-inline: 7px; }
}

@media (pointer: coarse) and (min-width: 761px) {
  .touch-controls { bottom: 128px; inset-inline-start: 220px; }
  .lookpad { bottom: 238px; inset-inline-end: 45px; }
}

@media (max-height: 520px) and (max-width: 930px) {
  .topbar { top: max(12px, env(safe-area-inset-top)); }
  .brand h1 { font-size: 18px; }
  .brand p { font-size: 6px; }
  .brand-mark { width: 20px; height: 25px; }
  .explore-dock { inset-inline-start: 14px; inset-inline-end: auto; width: 137px; top: 77px; bottom: auto; }
  .scope-section { position: static; width: auto; padding: 8px; }
  .scope-section .section-label, .style-section .section-label { display: none; }
  .preview-switch button { padding: 6px 5px; font-size: 10px; }
  .room-nav { max-height: 177px; flex-direction: column; gap: 0; padding: 1px 7px 7px; overflow-y: auto; }
  .room-button { padding: 6px 8px; width: 100%; font-size: 10px; }
  .room-index { display: inline; font-size: 8px; }
  .style-section { position: static; border-top: 1px solid var(--line); padding: 7px; }
  .material-switch { flex-direction: column; gap: 0; border: 0; padding: 0; background: transparent; }
  .material-switch button { font-size: 9px; padding: 5px; }
  .control-bar { inset-inline-start: 170px; inset-inline-end: 126px; bottom: 31px; flex-wrap: nowrap; gap: 5px; }
  .control-bar .floor-switch button { padding: 8px 5px; font-size: 9px; }
  .mode-switch { min-width: 81px; }
  .mode-switch button { padding: 7px; font-size: 9px; }
  .walk-button { width: auto; margin-inline-start: auto; padding: 9px; font-size: 10px; gap: 7px; }
  .map-panel { top: auto; bottom: 31px; inset-inline-end: 14px; width: 100px; }
  #minimap { height: 98px; }
  .help-panel { inset-inline-start: auto; inset-inline-end: 21px; top: 76px; bottom: auto; }
  .help-content { inset-inline-start: auto; inset-inline-end: 0; }
  .touch-controls { bottom: 100px; inset-inline-start: 175px; grid-template-columns: repeat(3, 29px); grid-template-rows: repeat(3, 29px); }
  .touch-controls button { font-size: 15px; border-radius: 8px; }
  .lookpad { bottom: 176px; inset-inline-end: 20px; width: 66px; height: 66px; }
}

@media (prefers-reduced-motion: reduce) {
  .loading-symbol { animation: none; border-top-color: #a39238; }
  .loading-screen { transition: none; }
}
