:root {
  color-scheme: light;
  --paper: #f4f2ed;
  --panel: #fbfaf7;
  --ink: #1e2a29;
  --muted: #66716f;
  --line: #d9ddd8;
  --line-strong: #c6ccc7;
  --accent: #2f655b;
  --accent-soft: #e2ebe7;
  --stage: #d9ddd9;
  --danger: #a34436;
  --header-height: 72px;
  font-family: Arial, "Noto Sans Hebrew", sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { color: var(--ink); background: var(--paper); }
button, a { font: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid rgba(47, 101, 91, .35); outline-offset: 2px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.app { height: 100%; display: grid; grid-template-rows: var(--header-height) minmax(0, 1fr); }
.header {
  z-index: 20; display: flex; align-items: center; gap: 24px; padding: 0 22px;
  border-bottom: 1px solid var(--line); background: rgba(251, 250, 247, .98);
}
.property-name { display: flex; align-items: center; gap: 12px; min-width: 250px; }
.home-mark { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--accent); background: #fff; }
.property-name h1 { margin: 0; font-size: 20px; line-height: 1.2; }
.property-name p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.view-switch { display: flex; align-self: center; padding: 3px; margin-inline: auto; border: 1px solid var(--line); border-radius: 8px; background: #eceeea; }
.view-button { min-width: 145px; height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 6px; color: #56615f; background: transparent; cursor: pointer; }
.view-button:hover { color: var(--ink); }
.view-button[aria-selected="true"] { color: var(--ink); background: #fff; box-shadow: 0 1px 3px rgba(23, 35, 32, .12); }
.header-actions { display: flex; gap: 7px; }
.action-button, .icon-button, .mobile-menu { height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: #fff; cursor: pointer; }
.action-button { gap: 7px; padding: 0 11px; text-decoration: none; font-size: 11px; }
.action-button svg { width: 17px; height: 17px; }
.icon-button { width: 40px; }
.action-button:hover, .icon-button:hover, .mobile-menu:hover { border-color: var(--accent); color: var(--accent); }
.mobile-menu { display: none; gap: 7px; padding: 0 12px; }

.workspace { min-height: 0; display: grid; grid-template-columns: 330px minmax(0, 1fr); direction: rtl; }
.property-panel { z-index: 12; min-height: 0; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--panel); }
.summary { padding: 22px 20px 18px; border-bottom: 1px solid var(--line); }
.status-badge { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; color: var(--accent); font-size: 11px; font-weight: 700; }
.status-badge span { width: 7px; height: 7px; border-radius: 50%; background: #39806e; }
.summary-heading h2 { margin: 0; font-size: 23px; letter-spacing: -.02em; }
.model-disclaimer { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; padding: 12px; border: 1px solid #d9aca4; border-right: 4px solid var(--danger); border-radius: 7px; color: #6f3930; background: #fff6f4; }
.model-disclaimer svg { width: 20px; height: 20px; flex: 0 0 auto; margin-top: 1px; color: var(--danger); stroke-width: 2; }
.model-disclaimer p { margin: 0; color: inherit; font-size: 12px; line-height: 1.55; }
.model-disclaimer strong { display: block; margin-bottom: 2px; color: var(--danger); font-size: 13px; }
.contact-cta { margin-top: 12px; font-size: 11px; line-height: 1.55; }
.contact-cta > span { display: block; color: var(--ink); font-weight: 700; }
.contact-email { display: inline-block; color: var(--accent); direction: ltr; font-size: 11px; text-underline-offset: 3px; user-select: text; }
.contact-email:hover { color: var(--ink); }
.whatsapp-contact { width: fit-content; display: flex; align-items: center; gap: 6px; margin-top: 8px; padding: 7px 9px; border: 1px solid #9fc8b2; border-radius: 6px; color: #1e6746; background: #edf8f1; text-decoration: none; font-weight: 700; }
.whatsapp-contact:hover { border-color: #1e6746; background: #e3f3e9; }
.whatsapp-contact svg { width: 18px; height: 18px; flex: 0 0 auto; stroke-width: 1.8; }
.whatsapp-contact small { padding-right: 2px; color: #47735e; font-size: 9px; font-weight: 400; }

.rooms-section { min-height: 0; display: flex; flex: 1; flex-direction: column; }
.section-title { display: flex; align-items: flex-end; justify-content: space-between; padding: 17px 20px 10px; }
.section-title span { color: var(--accent); font-size: 10px; font-weight: 700; }
.section-title h2 { margin: 3px 0 0; font-size: 17px; }
.section-title small { color: var(--muted); font-size: 10px; }
.room-list { min-height: 0; flex: 1; overflow: auto; padding: 4px 10px 12px; scrollbar-width: thin; scrollbar-color: #bbc3bd transparent; }
.room-button { width: 100%; min-height: 55px; display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid transparent; border-radius: 7px; color: #596461; text-align: right; background: transparent; cursor: pointer; }
.room-button:hover { color: var(--ink); background: #f1f3ef; }
.room-button[aria-current="true"] { border-color: #bbcec6; color: var(--ink); background: var(--accent-soft); }
.room-icon { width: 31px; height: 31px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: #fff; }
.room-icon svg { width: 17px; height: 17px; }
.room-button[aria-current="true"] .room-icon { border-color: #97b4aa; color: var(--accent); }
.room-copy strong { display: block; margin-bottom: 3px; color: inherit; font-size: 12px; }
.room-copy small { color: #7b8582; font-size: 10px; }
.panel-actions { display: none; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; padding: 12px 10px; border-top: 1px solid var(--line); }
.panel-actions a { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 7px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: #fff; text-align: center; text-decoration: none; font-size: 10px; }
.panel-actions a:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.panel-actions svg { width: 17px; height: 17px; flex: 0 0 auto; }
.panel-actions a span { min-width: 0; overflow-wrap: anywhere; user-select: text; }

.stage { position: relative; min-width: 0; min-height: 0; overflow: hidden; direction: rtl; background: var(--stage); }
/* model-viewer temporarily enlarges its internal canvas when it lowers the
   render scale during interaction. Keep that canvas anchored to the left;
   inheriting RTL makes the rendered portion slide out of view on mobile. */
model-viewer { width: 100%; height: 100%; direction: ltr; --poster-color: #e4e5e1; --progress-bar-height: 0; outline: 0; }
.walk-canvas { position: absolute; inset: 0; width: 100%; height: 100%; outline: 0; touch-action: none; cursor: grab; }
.walk-canvas.is-looking { cursor: grabbing; }
.walk-canvas[hidden] { display: none; }
.stage.walk-active model-viewer { display: none; }
.stage::after { content: ""; position: absolute; z-index: 1; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }

.stage-status { position: absolute; z-index: 5; top: 16px; right: 16px; min-height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid rgba(49, 62, 57, .2); border-radius: 7px; color: #33423f; background: rgba(251,250,247,.9); font-size: 11px; backdrop-filter: blur(8px); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #568d7f; }
.room-card { position: absolute; z-index: 6; right: 16px; bottom: 16px; width: min(390px, calc(100% - 150px)); padding: 17px 18px; border: 1px solid rgba(59, 74, 69, .22); border-radius: 9px; color: var(--ink); background: rgba(251,250,247,.94); backdrop-filter: blur(10px); }
.room-card[hidden] { display: none; }
.room-card > button { position: absolute; top: 10px; left: 10px; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: #fff; font-size: 20px; cursor: pointer; }
.room-card > span { color: var(--accent); font-size: 10px; font-weight: 700; }
.room-card h2 { margin: 4px 0 6px; font-size: 21px; }
.room-card p { margin: 0; color: #5f6967; font-size: 11px; line-height: 1.6; }

.stage-tools { position: absolute; z-index: 7; left: 16px; bottom: 16px; display: flex; gap: 6px; padding: 5px; border: 1px solid rgba(49,62,57,.2); border-radius: 8px; background: rgba(251,250,247,.92); }
.stage-tools button { min-width: 42px; height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 10px; border: 0; border-radius: 5px; color: #4e5b58; background: transparent; font-size: 10px; cursor: pointer; }
.stage-tools button:hover { color: var(--accent); background: var(--accent-soft); }
.stage-tools svg { width: 17px; height: 17px; }

.walk-intro { position: absolute; z-index: 11; inset: 50% auto auto 50%; width: min(430px, calc(100% - 32px)); padding: 25px; border: 1px solid #c9d0cb; border-radius: 10px; color: var(--ink); background: rgba(251,250,247,.97); transform: translate(-50%, -50%); text-align: center; }
.walk-intro[hidden] { display: none; }
.intro-label { color: var(--accent); font-size: 10px; font-weight: 700; }
.walk-intro h2 { margin: 6px 0 8px; font-size: 23px; }
.walk-intro p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.walk-intro > div { display: flex; justify-content: center; gap: 7px; margin-top: 17px; }
.primary-button { min-height: 40px; padding: 0 16px; border: 1px solid var(--accent); border-radius: 6px; color: #fff; background: var(--accent); font-weight: 700; cursor: pointer; }
.walk-touch { display: none; }
.walk-pitch { position: absolute; z-index: 8; left: 16px; bottom: 76px; display: none; width: 62px; height: 206px; padding: 10px 7px; border: 1px solid rgba(255,255,255,.5); border-radius: 10px; color: #fff; background: rgba(36,49,46,.48); align-items: center; flex-direction: column; gap: 6px; font-size: 9px; text-align: center; text-shadow: 0 1px 3px rgba(0,0,0,.6); backdrop-filter: blur(7px); }
.stage.walk-active .walk-pitch { display: flex; }
.walk-pitch input { width: 24px; min-height: 112px; flex: 1; margin: 0; direction: rtl; writing-mode: vertical-lr; accent-color: #d9eee8; cursor: ns-resize; }
.walk-pitch output { min-width: 42px; padding: 3px 4px; border-radius: 4px; color: #2f4c46; background: rgba(255,255,255,.88); font-size: 10px; font-weight: 700; text-shadow: none; }
.joystick { position: absolute; right: 22px; bottom: 78px; width: 108px; height: 108px; border: 1px solid rgba(255,255,255,.52); border-radius: 50%; background: rgba(36,49,46,.25); pointer-events: auto; touch-action: none; }
.joystick::before, .joystick::after { content: ""; position: absolute; inset: 50% 14px auto; height: 1px; background: rgba(255,255,255,.3); }
.joystick::after { transform: rotate(90deg); }
.joystick span { position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; margin: -22px; border: 1px solid rgba(255,255,255,.75); border-radius: 50%; background: rgba(47,101,91,.62); }
.look-hint { position: absolute; left: 20px; bottom: 92px; color: #fff; font-size: 10px; text-shadow: 0 1px 4px #000; }

.loading-layer { position: absolute; z-index: 10; inset: 0; display: grid; place-items: center; background: rgba(219,223,218,.75); pointer-events: none; transition: opacity .2s ease; }
.loading-layer.is-hidden { opacity: 0; }
.loading-layer > div { width: min(270px, calc(100% - 42px)); padding: 15px; border: 1px solid var(--line-strong); border-radius: 8px; background: rgba(251,250,247,.96); text-align: center; }
.loading-layer strong { display: block; margin-bottom: 10px; font-size: 12px; }
.progress { height: 3px; display: block; overflow: hidden; border-radius: 2px; background: #e0e4df; }
.progress span { width: 100%; height: 100%; display: block; background: var(--accent); transform: scaleX(0); transform-origin: right; }
.error-message { position: absolute; z-index: 15; inset: 50% auto auto 50%; width: min(420px, calc(100% - 36px)); display: none; padding: 20px; border: 1px solid #d9aca4; border-radius: 8px; color: #6f3930; background: #fff6f4; transform: translate(-50%,-50%); text-align: center; font-size: 12px; line-height: 1.6; }
.error-message strong { display: block; color: var(--danger); font-size: 14px; }
.scrim { display: none; }
.noscript { margin: 30px; }

@media (max-width: 900px) {
  .workspace { grid-template-columns: 285px minmax(0,1fr); }
  .room-card { width: min(350px, calc(100% - 140px)); }
  .action-button span { display: none; }
  .action-button { width: 40px; padding: 0; }
}

@media (max-width: 720px) {
  :root { --header-height: 64px; }
  .header { padding: 0 11px; gap: 8px; }
  .property-name { min-width: 0; }
  .home-mark, .property-name p, .header-actions { display: none; }
  .property-name h1 { max-width: 92px; overflow: hidden; font-size: 16px; white-space: nowrap; text-overflow: ellipsis; }
  .view-switch { margin-inline: auto 0; }
  .view-button { min-width: 60px; height: 36px; padding: 0 8px; font-size: 11px; }
  .view-button svg { display: none; }
  .mobile-menu { display: inline-flex; height: 36px; font-size: 11px; }
  .workspace { display: block; position: relative; }
  .property-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(330px, calc(100% - 38px)); transform: translateX(105%); transition: transform .2s ease; box-shadow: -12px 0 36px rgba(29,42,38,.18); }
  .panel-actions { display: grid; grid-template-columns: 1fr; }
  .app.nav-open .property-panel { transform: translateX(0); }
  .scrim { position: absolute; z-index: 11; inset: 0; border: 0; background: rgba(25,37,34,.42); }
  .app.nav-open .scrim { display: block; }
  .stage { width: 100%; height: 100%; }
  .room-card { right: 10px; left: 10px; bottom: 65px; width: auto; padding: 14px; }
  .room-card h2 { font-size: 18px; }
  .stage-tools { right: 10px; left: 10px; bottom: 9px; justify-content: center; }
  .stage-tools button { flex: 1; }
  .stage-status { top: 10px; right: 10px; }
}

@media (pointer: coarse) {
  .stage.walk-active .walk-touch { position: absolute; z-index: 8; inset: 0; display: block; pointer-events: none; }
  .walk-pitch { left: 12px; bottom: 68px; }
  .look-hint { left: 84px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
}
