/* 明昌 AR Demo — matches sample video UI */

:root {
  --demo-bg: #0a0c10;
  --demo-fg: #f2f4f6;
  --demo-muted: #8b97a5;
  --demo-line: rgba(255, 255, 255, 0.12);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: "Segoe UI", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: var(--demo-bg);
  color: var(--demo-fg);
  overflow: hidden;
}

.page-demo {
  position: relative;
  height: 100%;
}

.demo-top {
  position: absolute;
  z-index: 6;
  top: 0; left: 0; right: 0;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 12px 12px 28px;
  background: linear-gradient(180deg, rgba(8,10,14,.92), rgba(8,10,14,.25) 70%, transparent);
  pointer-events: none;
}
.demo-top > * { pointer-events: auto; }

.demo-top__actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.demo-top__back,
.demo-top__help {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--demo-line);
  background: rgba(255,255,255,0.08);
  color: var(--demo-fg);
  display: grid;
  place-items: center;
  text-decoration: none;
  font-size: 16px;
  cursor: pointer;
}
.demo-top__help[aria-expanded="true"] {
  background: #fff;
  color: #111;
  border-color: #fff;
  font-size: 11px;
  font-weight: 700;
}
#btn-intro {
  width: auto;
  min-width: 40px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.demo-top__title {
  text-align: center;
  display: grid;
  gap: 2px;
}
.demo-top__title strong {
  font-size: 15px;
  letter-spacing: 0.02em;
}
.demo-top__title span {
  font-size: 12px;
  color: var(--demo-muted);
}
.demo-size {
  display: block;
  margin-top: 2px;
  font-size: 11px !important;
  color: #c5d0db !important;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dim-hotspot {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 224, 138, 0.95);
  background: rgba(8, 12, 18, 0.88);
  color: #fff6d8;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  transform: translate(-50%, -50%);
}
.dim-hotspot[data-visible] {
  opacity: 1;
}

/* Always-visible 長寬高 panel (sim-ar / real-ar) */
.ar-dims {
  margin-top: 6px;
}
.ar-dims__title {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #ffe08a;
}
.ar-dims__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.ar-dims__grid > div {
  display: grid;
  gap: 2px;
  padding: 6px 4px;
  border-radius: 8px;
  background: rgba(255, 224, 138, 0.12);
  border: 1px solid rgba(255, 224, 138, 0.35);
  text-align: center;
}
.ar-dims__grid span {
  font-size: 10px;
  color: #ffe08a;
  font-weight: 700;
}
.ar-dims__grid strong {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
}
.ar-dims__grid em {
  font-style: normal;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.7);
}
.ar-dims--panel {
  position: absolute;
  z-index: 3;
  left: 12px;
  right: 12px;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(255, 224, 138, 0.45);
  backdrop-filter: blur(10px);
  pointer-events: none;
}
.ar-dims--panel .ar-dims { margin-top: 0; }
.sim-ar[data-mode="camera"] .ar-dims {
  display: block;
}
.sim-ar[data-mode="room"] .ar-dims {
  display: block;
}

/* 模組／部位：十字光點（非圓圈＋文字標記） */
.hotspot {
  position: relative;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  min-width: 28px !important;
  min-height: 28px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: transparent !important;
  font-size: 0 !important;
  font-weight: 400 !important;
  letter-spacing: 0 !important;
  cursor: pointer;
  box-shadow: none !important;
  transform: translate(-50%, -50%);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  z-index: 1;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.25s ease;
}
/* 舊版圓圈文字標籤：一律隱藏，避免快取殘留 */
.hotspot__label {
  display: none !important;
}
.hotspot__dot {
  display: none !important;
}
.hotspot.is-near,
.hotspot.is-active {
  opacity: 1;
}
.hotspot.is-distant:not(.is-active) {
  opacity: 0.22;
}
.hotspot.is-distant:not(.is-active) .hotspot__spark {
  animation: none;
  opacity: 0.55;
}
.hotspot__spark {
  position: relative;
  display: block;
  width: 14px;
  height: 14px;
  pointer-events: none;
  animation: hotspot-glow 2s ease-in-out infinite;
}
.hotspot__spark::before,
.hotspot__spark::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: #fff8e1;
  border-radius: 1px;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 6px 1px rgba(255, 213, 79, 0.85);
}
.hotspot__spark::before {
  width: 2px;
  height: 100%;
}
.hotspot__spark::after {
  width: 100%;
  height: 2px;
}
.hotspot__core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3px;
  height: 3px;
  margin: -1.5px 0 0 -1.5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px 2px rgba(255, 193, 7, 0.9);
}
.hotspot--part .hotspot__spark::before,
.hotspot--part .hotspot__spark::after {
  background: #e3f2fd;
  box-shadow: 0 0 6px 1px rgba(100, 181, 246, 0.85);
}
.hotspot--part .hotspot__core {
  box-shadow: 0 0 8px 2px rgba(66, 165, 245, 0.9);
}
.hotspot.is-active {
  z-index: 5;
}
.hotspot.is-active .hotspot__spark {
  width: 18px;
  height: 18px;
  animation: none;
}
.hotspot.is-active .hotspot__spark::before,
.hotspot.is-active .hotspot__spark::after {
  background: #ffecb3;
  box-shadow: 0 0 10px 2px rgba(255, 202, 40, 0.95);
}
.hotspot.is-active .hotspot__core {
  width: 4px;
  height: 4px;
  margin: -2px 0 0 -2px;
  background: #ffca28;
  box-shadow: 0 0 12px 3px rgba(255, 202, 40, 0.85);
}
.hotspot:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
@keyframes hotspot-glow {
  0%, 100% { opacity: 1; filter: brightness(1); }
  50% { opacity: 0.7; filter: brightness(1.25); }
}

/* 手機：可點熱區加大；預設不顯示成群標記（由 JS 只掛目前選取亮點） */
@media (max-width: 720px) {
  .hotspot {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }
  .hotspot__spark {
    width: 16px;
    height: 16px;
  }
  /* 說明改走底部介紹面板，不在模型旁開圓角氣泡 */
  .hotspot-callout {
    display: none !important;
  }
  .dim-hotspot {
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 10px;
  }
}

.hotspot-callout {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  width: min(240px, 62vw);
  padding: 12px 14px 12px 12px;
  border-radius: 12px;
  background: rgba(12, 16, 22, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  color: #d7e2ec;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.45;
  text-align: left;
  pointer-events: auto;
  cursor: default;
}
.hotspot-callout[hidden] { display: none !important; }
.hotspot-callout::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  background: rgba(12, 16, 22, 0.94);
  border-left: 1px solid rgba(255, 255, 255, 0.16);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  transform: rotate(45deg);
}
.hotspot-callout__close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.hotspot-callout__code {
  display: inline-block;
  margin: 0 0 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(198, 40, 40, 0.28);
  color: #ffc9c9;
  font-size: 10px;
  font-weight: 700;
}
.hotspot-callout__title {
  display: block;
  margin: 0 18px 6px 0;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}
.hotspot-callout__summary {
  margin: 0 0 6px;
  color: #c9d4de;
}
.hotspot-callout__size {
  margin: 0 0 6px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}
.hotspot-callout ul {
  margin: 0;
  padding-left: 16px;
  color: #aeb9c4;
  font-size: 11px;
}
.hotspot-callout li { margin: 3px 0; }

@media (max-width: 720px) {
  .hotspot-callout {
    left: 50%;
    top: auto;
    bottom: calc(100% + 12px);
    transform: translateX(-50%);
    width: min(260px, 78vw);
  }
  .hotspot-callout::before {
    left: 50%;
    top: auto;
    bottom: -5px;
    margin-left: -5px;
    margin-top: 0;
    border-left: 0;
    border-bottom: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.16);
    border-top: 1px solid rgba(255, 255, 255, 0.16);
  }
}

.color-bar {
  position: absolute;
  z-index: 6;
  top: 64px;
  left: 14px;
  display: flex;
  gap: 8px;
  padding: 6px;
  border-radius: 12px;
  background: rgba(12, 14, 18, 0.55);
  border: 1px solid var(--demo-line);
  backdrop-filter: blur(10px);
}

.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 2px solid rgba(255,255,255,0.35);
  background: var(--swatch, #333);
  cursor: pointer;
  padding: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.25);
}
.color-swatch.is-active {
  outline: 2px solid #fff;
  outline-offset: 2px;
  border-color: #fff;
}

.demo-intro {
  position: absolute;
  z-index: 7;
  top: 72px;
  right: 12px;
  width: min(360px, calc(100% - 24px));
  max-height: min(62vh, 560px);
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  background: rgba(14, 20, 26, 0.94);
  border: 1px solid var(--demo-line);
  backdrop-filter: blur(12px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}
.demo-intro__figure {
  display: block;
  width: 100%;
  margin: 0 0 10px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  overflow: hidden;
  background: #10161c;
  cursor: zoom-in;
  text-align: left;
  color: inherit;
}
.demo-intro__figure img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: contain;
  background: #0b1014;
}
.demo-intro__figure span {
  display: block;
  padding: 6px 8px 8px;
  font-size: 11px;
  color: var(--demo-muted);
}
.demo-intro-zoom {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.88);
}
.demo-intro-zoom[hidden] { display: none !important; }
.demo-intro-zoom img {
  max-width: min(960px, 100%);
  max-height: calc(100vh - 48px);
  object-fit: contain;
  border-radius: 8px;
  background: #111;
}
.demo-intro-zoom__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}
.demo-intro[hidden] { display: none; }
.demo-intro__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 12px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.demo-intro__head strong {
  font-size: 13px;
  letter-spacing: 0.02em;
}
.demo-intro__close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--demo-fg);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.demo-intro__body {
  padding: 12px 14px 14px;
  overflow: auto;
  color: #c9d4de;
  font-size: 13px;
  line-height: 1.55;
}
.demo-intro__hint { margin: 0; color: var(--demo-muted); }
.demo-intro__code {
  display: inline-block;
  margin: 0 0 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(198, 40, 40, 0.25);
  color: #ffc9c9;
  font-size: 11px;
}
.demo-intro__body h2 {
  margin: 0 0 6px;
  color: #fff;
  font-size: 16px;
}
.demo-intro__body > p { margin: 0 0 8px; }
.demo-intro__size {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #d7e2ec;
  font-size: 12px;
}
.demo-intro__size strong { color: #fff; }
.demo-intro__body ul {
  margin: 0 0 10px;
  padding-left: 18px;
}
.demo-intro__body li { margin: 4px 0; }
.demo-intro__parts {
  display: grid;
  gap: 6px;
  margin-top: 4px;
}
.demo-intro__part {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #eef3f7;
  border-radius: 10px;
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
}
.demo-intro__part strong {
  display: block;
  font-size: 12px;
  margin-bottom: 2px;
}
.demo-intro__part span {
  display: block;
  font-size: 11px;
  color: var(--demo-muted);
  line-height: 1.4;
}
.demo-intro__part.is-active {
  border-color: rgba(255, 202, 40, 0.55);
  background: rgba(255, 202, 40, 0.12);
}
.demo-intro__modules {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}
.demo-intro__mod {
  appearance: none;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #eef3f7;
  border-radius: 10px;
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
}
.demo-intro__mod strong {
  display: block;
  font-size: 12px;
  margin-bottom: 2px;
}
.demo-intro__mod span {
  display: block;
  font-size: 11px;
  color: var(--demo-muted);
}

.product-rail {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: calc(128px + var(--safe-bottom));
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  max-width: min(92vw, 520px);
  overflow-x: auto;
  padding: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.product-rail::-webkit-scrollbar { display: none; }

.product-chip {
  flex: 0 0 auto;
  appearance: none;
  border: 1px solid var(--demo-line);
  background: rgba(16, 18, 22, 0.72);
  color: var(--demo-fg);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}
.product-chip.is-active {
  background: #fff;
  color: #111;
  border-color: #fff;
}

.demo-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse 70% 50% at 50% 42%, #2a313a 0%, #12161c 55%, #07090c 100%);
  --poster-color: transparent;
}

.demo-ar-actions {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: calc(18px + var(--safe-bottom));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(92vw, 360px);
}

.demo-ar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 13px 18px;
  background: #fff;
  color: #121417;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 36px rgba(0,0,0,.4);
  white-space: nowrap;
}
.demo-ar-btn--system {
  background: rgba(20, 24, 28, 0.72);
  color: #eef3f7;
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: none;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
}
.demo-ar-btn__icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.demo-hint {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: calc(118px + var(--safe-bottom));
  transform: translateX(-50%);
  margin: 0;
  max-width: 90vw;
  text-align: center;
  font-size: 11px;
  color: var(--demo-muted);
  pointer-events: none;
  opacity: 0.9;
}

/* —— Simulated AR overlay —— */
.sim-ar {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: #0a0c10;
}
.sim-ar[hidden] { display: none !important; }
.sim-ar__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sim-ar__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}
.sim-ar__canvas:active { cursor: grabbing; }
.sim-ar__chrome {
  position: absolute;
  z-index: 2;
  left: 0; right: 0; top: 0;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 14px 14px 40px;
  background: linear-gradient(180deg, rgba(0,0,0,.55), transparent);
  pointer-events: none;
}
.sim-ar__chrome > * { pointer-events: auto; }
.sim-ar__mid {
  display: grid;
  gap: 8px;
  justify-items: center;
}
.sim-ar__modes {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.2);
}
.sim-ar__mode {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  background: transparent;
  cursor: pointer;
}
.sim-ar__mode.is-active {
  background: #fff;
  color: #111;
}
.sim-ar__mode.is-disabled,
.sim-ar__mode:disabled {
  opacity: 0.45;
}
.sim-ar[data-mode="room"] {
  background: #c5ccd4;
}
.sim-ar[data-mode="camera"] {
  background: #0a0c10;
}
.sim-ar__icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}
.sim-ar__status {
  margin: 8px 0 0;
  text-align: center;
  font-size: 13px;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,.6);
  line-height: 1.4;
}
.sim-ar__actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}
.sim-ar__chip {
  border: 1px solid rgba(255,255,255,0.28);
  background: rgba(0,0,0,0.45);
  color: #fff;
  border-radius: 999px;
  padding: 10px 12px;
  font-size: 12px;
  cursor: pointer;
}
.sim-ar__chip--scale.is-active {
  background: #fff;
  color: #111;
  border-color: #fff;
  font-weight: 700;
}
.sim-ar__size {
  position: absolute;
  z-index: 2;
  left: 12px;
  top: calc(88px + env(safe-area-inset-top, 0px));
  display: grid;
  gap: 4px;
  max-width: min(280px, calc(100% - 88px));
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0,0,0,0.58);
  border: 1px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
  color: #fff;
  pointer-events: none;
}
.sim-ar__size strong {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.01em;
  line-height: 1.35;
}
.sim-ar__scale-badge {
  font-size: 11px;
  color: #ffc978;
}
.sim-ar__scale-badge.is-real {
  color: #8dffb0;
}
.sim-ar__size-note {
  font-size: 10px;
  font-style: normal;
  color: rgba(255,255,255,0.65);
  line-height: 1.35;
}
.sim-ar[data-mode="camera"] .sim-ar__size-note {
  display: none;
}
.sim-ar__lift {
  position: absolute;
  z-index: 2;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 16px;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.22);
  backdrop-filter: blur(8px);
  touch-action: none;
  user-select: none;
}
.sim-ar__lift-btn {
  appearance: none;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 12px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.sim-ar__lift-btn:active {
  background: #fff;
  color: #111;
}
.sim-ar__lift-label {
  font-size: 11px;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.06em;
}
.sim-ar__hint {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: calc(18px + var(--safe-bottom));
  transform: translateX(-50%);
  margin: 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(0,0,0,0.5);
  color: #e8eef4;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  max-width: calc(100% - 24px);
  overflow: hidden;
  text-overflow: ellipsis;
}

.boot-error {
  position: fixed;
  z-index: 50;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(360px, calc(100% - 32px));
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(120, 20, 20, 0.95);
  color: #fff;
  font-size: 13px;
  line-height: 1.5;
  cursor: pointer;
}
.boot-error[hidden] { display: none !important; }
body.is-sim-ar model-viewer.demo-stage {
  visibility: hidden;
  pointer-events: none;
}

.demo-progress {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 48%;
  height: 3px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  overflow: hidden;
}
.demo-progress__bar {
  height: 100%;
  width: 0%;
  background: #fff;
  transition: width .15s linear;
}
model-viewer:not([data-loading]) .demo-progress { display: none; }

.demo-help {
  position: absolute;
  z-index: 10;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(360px, calc(100% - 32px));
  padding: 18px 18px 14px;
  border-radius: 16px;
  background: rgba(14, 18, 24, 0.96);
  border: 1px solid var(--demo-line);
  box-shadow: 0 20px 50px rgba(0,0,0,.45);
}
.demo-help[hidden] { display: none; }
.demo-help h2 { margin: 0 0 10px; font-size: 16px; }
.demo-help ol {
  margin: 0 0 14px;
  padding-left: 18px;
  color: var(--demo-muted);
  font-size: 13px;
  line-height: 1.55;
}
.demo-help button {
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: #fff;
  color: #111;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 720px) {
  .demo-intro {
    top: auto;
    right: 10px;
    left: 10px;
    bottom: calc(168px + var(--safe-bottom));
    width: auto;
    max-height: 38vh;
  }
  .color-bar { top: 70px; }
}

@media (min-width: 900px) {
  .demo-hint { bottom: calc(128px + var(--safe-bottom)); }
  .product-rail { bottom: calc(140px + var(--safe-bottom)); }
}

/* Real-world WebXR AR overlay */
.real-ar {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: transparent;
  pointer-events: none;
}
.real-ar[hidden] { display: none !important; }
.real-ar__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
.real-ar__chrome {
  position: absolute;
  z-index: 2;
  top: 0; left: 0; right: 0;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 8px;
  align-items: start;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 12px;
  pointer-events: none;
}
.real-ar__chrome > * { pointer-events: auto; }
.real-ar__mid {
  display: grid;
  gap: 6px;
  justify-items: center;
  text-align: center;
}
.real-ar__status {
  margin: 0;
  font-size: 13px;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,.7);
  line-height: 1.4;
}
.real-ar__badge {
  margin: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,.55);
  border: 1px solid rgba(255,224,138,.55);
  color: #ffe08a;
  font-size: 11px;
  font-weight: 700;
}
.real-ar__icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}
.real-ar__chip {
  border: 1px solid rgba(255,255,255,0.28);
  background: rgba(0,0,0,0.5);
  color: #fff;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.real-ar__hint {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  margin: 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(0,0,0,0.55);
  color: #e8eef4;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  max-width: calc(100% - 24px);
  overflow: hidden;
  text-overflow: ellipsis;
}
body.is-real-ar {
  overflow: hidden;
}
