:root {
  --accent: #c3c641;
  --surface: rgba(8, 10, 12, 0.72);
  --surface-strong: rgba(8, 10, 12, 0.94);
  --line: rgba(255, 255, 255, 0.14);
  --text: #fff;
  --muted: rgba(255, 255, 255, 0.66);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  background: #050607;
  color: var(--text);
  font-family: Tahoma, Arial, sans-serif;
}
button, input, textarea { font: inherit; }
button { color: inherit; }

#panorama {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #050607;
}
.twins-cubemap-canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: grab;
  touch-action: none;
  transition: opacity 260ms ease;
}
.viewer-ready .twins-cubemap-canvas { opacity: 1; }
.twins-cubemap-canvas.is-dragging { cursor: grabbing; }
.twins-directional-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition: opacity 180ms ease, transform 140ms ease;
  transform-origin: center;
}
.viewer-ready .twins-directional-image { opacity: 1; }
.twins-directional-image.is-dragging { cursor: grabbing; }
.viewer-error {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: #fff;
  background: #050607;
}

.shade { position: fixed; left: 0; right: 0; pointer-events: none; z-index: 3; }
.shade-top { top: 0; height: 150px; background: linear-gradient(to bottom, rgba(0,0,0,.65), transparent); }
.shade-bottom { bottom: 0; height: 170px; background: linear-gradient(to top, rgba(0,0,0,.68), transparent); }

.topbar {
  position: fixed;
  z-index: 10;
  top: var(--safe-top);
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(195,198,65,.5);
  background: rgba(195,198,65,.2);
  font-size: 12px;
  font-weight: 900;
}
.brand-copy strong, .brand-copy span { display: block; }
.brand-copy strong { font-size: 14px; }
.brand-copy span { margin-top: 2px; color: var(--muted); font-size: 10px; direction: ltr; text-align: right; }

.mini-button, .close-button, .service-button {
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 12px 30px rgba(0,0,0,.22);
  cursor: pointer;
}
.mini-button {
  min-height: 38px;
  padding: 0 13px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 800;
}

.model-caption {
  position: fixed;
  z-index: 7;
  right: 18px;
  bottom: calc(92px + var(--safe-bottom));
  max-width: min(390px, calc(100vw - 36px));
  pointer-events: none;
  text-shadow: 0 3px 18px rgba(0,0,0,.74);
}
.caption-kicker {
  display: block;
  margin-bottom: 5px;
  color: rgba(255,255,255,.58);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.model-caption h1 { margin: 0; font-size: clamp(24px, 4vw, 38px); line-height: 1.1; }
.model-caption p { margin: 8px 0 0; color: rgba(255,255,255,.75); font-size: 12px; line-height: 1.7; }

.service-bar {
  position: fixed;
  z-index: 11;
  left: 50%;
  bottom: calc(14px + var(--safe-bottom));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px;
  background: rgba(5,7,8,.5);
}
.service-button {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1px;
  padding: 0;
}
.service-button > span { font-size: 17px; line-height: 1; }
.service-button small { font-size: 8px; color: rgba(255,255,255,.72); font-weight: 800; }
.service-button.active { border-color: rgba(195,198,65,.5); background: rgba(195,198,65,.2); }

.drawer-backdrop, .modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 29;
  background: rgba(0,0,0,.52);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.models-drawer {
  position: fixed;
  z-index: 30;
  top: 0;
  right: 0;
  width: min(390px, 92vw);
  height: 100%;
  padding: calc(18px + var(--safe-top)) 16px calc(18px + var(--safe-bottom));
  overflow: auto;
  background: var(--surface-strong);
  border-left: 1px solid var(--line);
  transform: translateX(105%);
  transition: transform 220ms ease;
}
.models-drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.drawer-head h2, .quote-modal h2 { margin: 3px 0 0; font-size: 22px; }
.close-button {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 24px;
  line-height: 1;
}
.models-list { display: grid; gap: 10px; margin-top: 20px; }
.model-card {
  width: 100%;
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  padding: 8px;
  text-align: right;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.055);
  cursor: pointer;
}
.model-card.active { border-color: rgba(195,198,65,.62); background: rgba(195,198,65,.12); }
.model-card img { width: 92px; height: 92px; border-radius: 13px; object-fit: cover; }
.model-card-content { min-width: 0; padding: 5px 2px; }
.model-card-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.model-card strong { font-size: 14px; }
.model-card em { font-size: 8px; font-style: normal; font-weight: 900; padding: 4px 7px; border-radius: 999px; background: rgba(255,255,255,.1); }
.model-card span { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.model-card code { display: block; margin-top: 7px; color: rgba(195,198,65,.85); font-size: 9px; direction: ltr; text-align: right; }
.drawer-note { margin: 18px 3px 0; color: rgba(255,255,255,.48); font-size: 10px; line-height: 1.7; }

.modal-backdrop { z-index: 40; display: grid; place-items: center; padding: 16px; }
.quote-modal {
  position: relative;
  width: min(470px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(11,13,15,.97);
}
.modal-close { position: absolute; top: 14px; left: 14px; }
.modal-copy { margin: 9px 0 17px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.quote-modal form { display: grid; gap: 12px; }
.quote-modal label { display: grid; gap: 6px; color: rgba(255,255,255,.78); font-size: 11px; font-weight: 800; }
.quote-modal input, .quote-modal textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  background: rgba(255,255,255,.07);
  color: #fff;
  padding: 12px 13px;
}
.submit-button {
  min-height: 45px;
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  color: #171806;
  font-weight: 900;
  cursor: pointer;
}
.form-status { min-height: 18px; margin: 0; font-size: 11px; color: var(--muted); }
.toast {
  position: fixed;
  z-index: 60;
  top: calc(70px + var(--safe-top));
  left: 50%;
  transform: translate(-50%, -12px);
  max-width: calc(100vw - 32px);
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(5,7,8,.88);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

[hidden] { display: none !important; }
noscript { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; background: #050607; color: #fff; padding: 20px; }

@media (max-width: 680px) {
  .topbar { padding: 10px 11px; }
  .brand-copy strong { font-size: 12px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
  .model-caption { right: 13px; bottom: calc(88px + var(--safe-bottom)); max-width: calc(100vw - 26px); }
  .model-caption h1 { font-size: 24px; }
  .model-caption p { max-width: 310px; font-size: 10px; }
  .service-bar { gap: 4px; padding: 5px; border-radius: 17px; }
  .service-button { width: 44px; height: 44px; border-radius: 12px; }
  .desktop-only { display: none; }
  .mini-button { min-height: 34px; padding: 0 10px; font-size: 10px; }
}
