/* ============================================================================
   Lumina Shelter — M5.5 Unified Warm Obsidian-Umber Editorial Gallery HUD
   Frozen 5-Round Spec:
   - Strict 3-Zone Separation:
       Top-Right (4 items: Sound · Snapshot · Zen · More popover)
       Left Rail (Single compact Whole-Home Palette card — zero dossier/fake scores)
       Right Rail (Solar Dial + Weather Clear/Rain + Apply Recommended Light + Drapery Drawer)
       Bottom 2-Layer Dock ("What to Edit" slot row + 48x48 swatches / Free Layout bar,
                            above "Where to Look" Mode + 9 Cameras pill)
   - Pure 48x48px Cursor-Locked Swatch Ghost (zero text card, zero offset, zero tilt)
   - Live DOMRect Safe-Area 3D Callout Pins (320ms calm settle fade-in)
   - Mobile 390px Responsive Single-Line Tabs + 44px Touch Targets + Zen Exit Pill
   ============================================================================ */

:root {
  --hud-night: 0;
  --hud-glass: rgba(24, 21, 18, calc(0.68 + var(--hud-night) * 0.12));
  --hud-glass-deep: rgba(18, 16, 14, calc(0.84 + var(--hud-night) * 0.08));
  --hud-card: rgba(255, 248, 236, 0.048);
  --hud-card-hover: rgba(255, 248, 236, 0.095);
  --hud-border: rgba(244, 239, 230, calc(0.11 + var(--hud-night) * 0.03));
  --hud-border-strong: rgba(216, 185, 142, 0.48);
  --hud-ink: #f4efe6;
  --hud-ink-soft: #c4b9a8;
  --hud-ink-muted: #8f8578;
  --hud-accent: #d8b98e;
  --hud-accent-bright: #f2e1c4;
  --hud-accent-bg: rgba(216, 185, 142, 0.16);
  --hud-warn: #e9a96b;
  --hud-warn-bg: rgba(233, 169, 107, 0.14);
  --hud-shadow: 0 18px 46px rgba(8, 6, 4, 0.42), inset 0 1px 0 rgba(255, 248, 236, 0.08);
  --hud-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --hud-radius-outer: 18px;
  --hud-radius-card: 12px;
  --hud-radius-tile: 10px;
}

.ls-hud,
.ls-hud * {
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
}

.ls-hud {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--hud-ink);
  letter-spacing: 0.01em;
}

.ls-hud button,
.ls-hud input {
  font-family: inherit;
  color: inherit;
}

/* ---------- Shared Warm Obsidian Glass Surface ---------- */
.ls-glass {
  background: var(--hud-glass);
  backdrop-filter: blur(22px) saturate(135%);
  -webkit-backdrop-filter: blur(22px) saturate(135%);
  border: 1px solid var(--hud-border);
  border-radius: var(--hud-radius-outer);
  box-shadow: var(--hud-shadow);
  pointer-events: auto;
  transition:
    background 0.55s var(--hud-ease),
    border-color 0.32s var(--hud-ease),
    transform 0.45s var(--hud-ease),
    opacity 0.36s var(--hud-ease);
}

/* ---------- Top Editorial Header Bar (Ultra-Slim 4-Item Utility) ---------- */
.ls-topbar {
  position: fixed;
  top: 16px;
  left: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  pointer-events: none;
  z-index: 32;
  transition: opacity 0.36s var(--hud-ease), transform 0.45s var(--hud-ease);
}

.ls-brand {
  pointer-events: auto;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 999px;
  flex-shrink: 0;
  white-space: nowrap;
}

.ls-brand-title {
  font-family: "Georgia", "Times New Roman", serif;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--hud-accent-bright);
  text-transform: uppercase;
}

.ls-brand-tag {
  font-size: 10.5px;
  color: var(--hud-ink-soft);
  letter-spacing: 0.04em;
}
.ls-brand-tag:empty { display: none; }

@media (max-width: 1120px) {
  .ls-brand-tag { display: none; }
}

.ls-utility-wrap {
  position: relative;
  pointer-events: auto;
  flex-shrink: 0;
}

.ls-utility-bar {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px 6px;
  border-radius: 999px;
  white-space: nowrap;
}

.ls-util-sep {
  width: 1px;
  height: 15px;
  background: rgba(244, 239, 230, 0.12);
  margin: 0 3px;
  flex-shrink: 0;
}

.ls-util-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--hud-ink-soft);
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.26s var(--hud-ease);
}

.ls-util-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ls-util-btn:hover {
  color: var(--hud-ink);
  background: var(--hud-card-hover);
}

.ls-util-btn.is-active {
  color: var(--hud-accent-bright);
  background: var(--hud-accent-bg);
  border-color: var(--hud-border-strong);
}

.ls-util-more-btn {
  width: 32px;
  padding: 0;
}

.ls-storage-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hud-warn);
  box-shadow: 0 0 8px rgba(233, 169, 107, 0.85);
  display: none;
}

.ls-util-more-btn.has-storage-warn .ls-storage-dot {
  display: block;
}

/* ---------- More Popover (3D Pins · Side Panels · Reset · Lang · Storage Status) ---------- */
.ls-more-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 224px;
  padding: 10px;
  border-radius: 16px;
  background: var(--hud-glass-deep);
  display: none;
  flex-direction: column;
  gap: 6px;
  z-index: 60;
}

.ls-more-popover.is-open {
  display: flex;
}

.ls-pop-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(244, 239, 230, 0.06);
  background: var(--hud-card);
  color: var(--hud-ink);
  font-size: 11.5px;
  text-align: left;
  cursor: pointer;
  transition: all 0.22s var(--hud-ease);
}

.ls-pop-item:hover {
  background: var(--hud-card-hover);
  border-color: rgba(244, 239, 230, 0.16);
}

.ls-pop-pill {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--hud-ink-muted);
  background: rgba(255, 248, 236, 0.06);
}

.ls-pop-item.is-active .ls-pop-pill {
  color: var(--hud-accent-bright);
  background: var(--hud-accent-bg);
}

.ls-pop-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 6px;
  font-size: 11px;
  color: var(--hud-ink-soft);
}

.ls-lang-switch {
  display: inline-flex;
  background: rgba(255, 248, 236, 0.06);
  border-radius: 999px;
  padding: 2px;
}

.ls-lang-btn {
  border: none;
  background: transparent;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  color: var(--hud-ink-muted);
  cursor: pointer;
  transition: all 0.22s var(--hud-ease);
}

.ls-lang-btn.is-active {
  background: var(--hud-accent-bg);
  color: var(--hud-accent-bright);
}

.ls-storage-box {
  margin-top: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(244, 239, 230, 0.07);
  background: rgba(255, 248, 236, 0.03);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ls-storage-box.is-warn {
  border-color: rgba(233, 169, 107, 0.42);
  background: var(--hud-warn-bg);
}

.ls-storage-text {
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--hud-ink-muted);
}

.ls-storage-box.is-warn .ls-storage-text {
  color: #f6d3ae;
}

/* ---------- Zen Mode Floating Exit Pill (Always Reachable on Desktop & 390px) ---------- */
.ls-zen-exit {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 45;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--hud-accent-bright);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
}

.ls-hud.is-zen .ls-zen-exit {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.ls-hud.is-zen .ls-topbar,
.ls-hud.is-zen .ls-rail,
.ls-hud.is-zen .ls-dock-wrap,
.ls-hud.is-zen .ls-leader-layer {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

/* ---------- Side Narrow Rails (Left 214px Single Card / Right 222px Atmosphere) ---------- */
.ls-rail {
  position: fixed;
  top: 72px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100vh - 224px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  z-index: 25;
  transition: transform 0.5s var(--hud-ease), opacity 0.36s var(--hud-ease);
}
.ls-rail::-webkit-scrollbar { display: none; }

.ls-rail-left { left: 20px; width: 214px; }
.ls-rail-right { right: 20px; width: 222px; }

.ls-hud.is-collapsed .ls-rail-left { transform: translateX(-248px); opacity: 0; pointer-events: none; }
.ls-hud.is-collapsed .ls-rail-right { transform: translateX(254px); opacity: 0; pointer-events: none; }

.ls-panel {
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ls-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.ls-sec-title {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hud-ink-soft);
}

.ls-sec-badge {
  font-size: 10px;
  color: var(--hud-accent);
  background: rgba(216, 185, 142, 0.11);
  border: 1px solid rgba(216, 185, 142, 0.24);
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

.ls-sec-badge.is-custom {
  color: var(--hud-ink-soft);
  background: rgba(255, 248, 236, 0.06);
  border-color: rgba(244, 239, 230, 0.12);
}

/* ---------- Left Rail: Single Sleek Whole-Home Palette Card ---------- */
.ls-theme-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.ls-theme-card {
  border: 1px solid rgba(244, 239, 230, 0.08);
  background: var(--hud-card);
  border-radius: var(--hud-radius-card);
  padding: 8px 9px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.26s var(--hud-ease);
}

.ls-theme-card:hover {
  background: var(--hud-card-hover);
  border-color: rgba(244, 239, 230, 0.20);
  transform: translateY(-1px);
}

.ls-theme-card.is-active {
  background: var(--hud-accent-bg);
  border-color: var(--hud-border-strong);
}

.ls-theme-bar {
  display: flex;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  gap: 1px;
}
.ls-theme-bar span { flex: 1; }

.ls-theme-name {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--hud-ink);
}

.ls-theme-note {
  font-size: 10.5px;
  color: var(--hud-ink-muted);
  line-height: 1.45;
  padding-top: 6px;
  border-top: 1px solid rgba(244, 239, 230, 0.07);
}

/* ---------- Right Rail: Unified Atmosphere (Solar + Weather + Recommended Light + Drawer) ---------- */
.ls-clock-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.ls-clock-time {
  font-family: "Georgia", serif;
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--hud-ink);
  font-variant-numeric: tabular-nums;
}

.ls-clock-phase {
  font-size: 11px;
  color: var(--hud-accent);
}

.ls-sun-arc-wrap {
  position: relative;
  width: 100%;
  height: 64px;
  cursor: grab;
  touch-action: none;
}
.ls-sun-arc-wrap:active { cursor: grabbing; }
.ls-sun-arc-svg { width: 100%; height: 100%; overflow: visible; }

.ls-time-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.ls-micro-pill {
  height: 26px;
  border-radius: 999px;
  border: 1px solid rgba(244, 239, 230, 0.09);
  background: var(--hud-card);
  color: var(--hud-ink-soft);
  font-size: 10.5px;
  cursor: pointer;
  transition: all 0.24s var(--hud-ease);
}

.ls-micro-pill:hover {
  color: var(--hud-ink);
  background: var(--hud-card-hover);
}

.ls-micro-pill.is-active {
  color: var(--hud-accent-bright);
  background: var(--hud-accent-bg);
  border-color: var(--hud-border-strong);
}

.ls-subtle-btn {
  width: 100%;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(244, 239, 230, 0.11);
  background: rgba(255, 248, 236, 0.045);
  color: var(--hud-ink-soft);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.24s var(--hud-ease);
}

.ls-subtle-btn:hover:not(:disabled) {
  color: var(--hud-ink);
  background: var(--hud-card-hover);
  border-color: var(--hud-border-strong);
}

.ls-subtle-btn.is-accent {
  color: var(--hud-accent-bright);
  background: var(--hud-accent-bg);
  border-color: var(--hud-border-strong);
}

.ls-subtle-btn.is-holding {
  color: #1c1814;
  background: var(--hud-accent-bright);
  border-color: var(--hud-accent-bright);
  transform: scale(0.98);
}

.ls-subtle-btn:disabled {
  opacity: 0.36;
  cursor: not-allowed;
}

/* ---------- Collapsible Lighting & Drapery Drawer ---------- */
.ls-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--hud-ink);
}

.ls-drawer-chev {
  font-size: 11px;
  color: var(--hud-ink-muted);
  transition: transform 0.32s var(--hud-ease);
}
.ls-drawer-open .ls-drawer-chev { transform: rotate(180deg); }

.ls-drawer-body {
  display: flex;
  flex-direction: column;
  gap: 9px;
  overflow: hidden;
  max-height: 440px;
  opacity: 1;
  transition: max-height 0.4s var(--hud-ease), opacity 0.3s var(--hud-ease), margin 0.3s var(--hud-ease);
}
.ls-drawer-body.is-collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: -10px;
  pointer-events: none;
}

.ls-scope-caption {
  font-size: 10px;
  color: var(--hud-ink-muted);
  line-height: 1.35;
}

.ls-zone-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.ls-zone-pill {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(244, 239, 230, 0.08);
  background: var(--hud-card);
  color: var(--hud-ink-soft);
  font-size: 10.5px;
  cursor: pointer;
  transition: all 0.22s var(--hud-ease);
}
.ls-zone-pill:hover { color: var(--hud-ink); background: var(--hud-card-hover); }
.ls-zone-pill.is-active {
  color: var(--hud-accent-bright);
  background: var(--hud-accent-bg);
  border-color: var(--hud-border-strong);
}

.ls-scene-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.ls-slider-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ls-slider-head {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--hud-ink-soft);
}

.ls-slider-val {
  color: var(--hud-accent-bright);
  font-variant-numeric: tabular-nums;
}

.ls-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(244, 239, 230, 0.14);
  outline: none;
}

.ls-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--hud-accent-bright);
  border: 2px solid #221e1a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: transform 0.2s var(--hud-ease);
}
.ls-range::-webkit-slider-thumb:hover { transform: scale(1.14); }

/* ---------- Smart X-Ray Panels (Unified Warm Obsidian-Umber) ---------- */
.ls-smart-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 220px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.ls-cat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 9px;
  border-radius: 10px;
  border: 1px solid rgba(244, 239, 230, 0.08);
  background: var(--hud-card);
  cursor: pointer;
  font-size: 11px;
  transition: all 0.22s var(--hud-ease);
}
.ls-cat-row.is-off { opacity: 0.42; }

.ls-cat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 7px;
  display: inline-block;
}

.ls-dev-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 9px;
  border: 1px solid rgba(244, 239, 230, 0.07);
  background: var(--hud-card);
  cursor: pointer;
  font-size: 11px;
  text-align: left;
  transition: all 0.2s var(--hud-ease);
}
.ls-dev-item:hover,
.ls-dev-item.is-selected {
  background: var(--hud-accent-bg);
  border-color: var(--hud-border-strong);
}

/* ---------- Bottom 2-Layer Architectural Dock ("改什么" + "去哪看") ---------- */
.ls-dock-wrap {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 28;
  pointer-events: none;
  transition: opacity 0.36s var(--hud-ease), transform 0.45s var(--hud-ease);
}

/* Upper Layer: "改什么" (Single Horizontal Slot Row + Centered 48x48 Swatches) */
.ls-edit-bar {
  width: min(724px, calc(100vw - 24px));
  padding: 9px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  opacity: 1;
  transform: translateY(0) scale(1);
  transition:
    opacity 0.30s var(--hud-ease),
    transform 0.34s var(--hud-ease),
    max-height 0.34s var(--hud-ease),
    padding 0.30s var(--hud-ease),
    margin 0.30s var(--hud-ease),
    border-color 0.26s var(--hud-ease);
}

.ls-edit-bar.is-hidden {
  opacity: 0;
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-bottom: -8px;
  border-color: transparent;
  transform: translateY(12px) scale(0.985);
  pointer-events: none;
  overflow: hidden;
}

.ls-edit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 28px;
}

/* Liquid Champagne Sliding Indicator Pill */
.ls-sliding-pill {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 999px;
  background: var(--hud-accent-bg);
  border: 1px solid var(--hud-border-strong);
  box-shadow: 0 2px 12px rgba(216, 185, 142, 0.16), inset 0 1px 0 rgba(255, 244, 224, 0.14);
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  will-change: transform, width, opacity;
  transition:
    transform 0.36s var(--hud-ease),
    width 0.36s var(--hud-ease),
    height 0.30s var(--hud-ease),
    opacity 0.22s ease;
}

.ls-sliding-pill.is-ready {
  opacity: 1;
}

.ls-sliding-pill.is-instant {
  transition: none !important;
}

.ls-tab-strip {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: safe center;
  flex-wrap: nowrap;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  min-width: 0;
  padding-bottom: 1px;
}
.ls-tab-strip::-webkit-scrollbar { display: none; }

.ls-slot-tab {
  position: relative;
  z-index: 1;
  height: 26px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(244, 239, 230, 0.08);
  background: rgba(255, 248, 236, 0.035);
  color: var(--hud-ink-soft);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: color 0.24s var(--hud-ease), background 0.24s var(--hud-ease), border-color 0.24s var(--hud-ease), transform 0.18s var(--hud-ease);
}
.ls-slot-tab:hover { color: var(--hud-ink); background: var(--hud-card-hover); }
.ls-slot-tab:active { transform: scale(0.95); }
.ls-slot-tab.is-active {
  color: var(--hud-accent-bright);
  background: transparent;
  border-color: transparent;
}

.ls-edit-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.ls-redo-pill {
  height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(244, 239, 230, 0.11);
  background: rgba(255, 248, 236, 0.05);
  color: var(--hud-ink-soft);
  font-size: 10.5px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.22s var(--hud-ease);
}
.ls-redo-pill:hover:not(:disabled) {
  color: var(--hud-accent-bright);
  border-color: var(--hud-border-strong);
  background: var(--hud-accent-bg);
}
.ls-redo-pill:active:not(:disabled) { transform: scale(0.95); }
.ls-redo-pill:disabled { opacity: 0.30; cursor: not-allowed; }

.ls-undo-pill {
  height: 26px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(244, 239, 230, 0.11);
  background: rgba(255, 248, 236, 0.05);
  color: var(--hud-ink-soft);
  font-size: 10.5px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: all 0.22s var(--hud-ease);
}
.ls-undo-pill:hover:not(:disabled) {
  color: var(--hud-accent-bright);
  border-color: var(--hud-border-strong);
  background: var(--hud-accent-bg);
}
.ls-undo-pill:active:not(:disabled) { transform: scale(0.95); }
.ls-undo-pill:disabled {
  opacity: 0.34;
  cursor: not-allowed;
}

.ls-edit-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70px;
}

@keyframes lsSwatchIn {
  from {
    opacity: 0.35;
    transform: translateY(5px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ls-swatch-rail {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: safe center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 2px 0;
  touch-action: pan-x;
}
.ls-swatch-rail::-webkit-scrollbar { display: none; }

.ls-swatch-rail.is-entering .ls-swatch-tile {
  animation: lsSwatchIn 0.20s var(--hud-ease) both;
  animation-delay: calc(var(--i, 0) * 14ms);
}

/* Tactile 48×48px Square Swatch Tiles */
.ls-swatch-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 4px 4px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  cursor: grab;
  flex-shrink: 0;
  width: 66px;
  transition: transform 0.24s var(--hud-ease), background 0.24s var(--hud-ease), border-color 0.24s var(--hud-ease), box-shadow 0.24s var(--hud-ease);
}
.ls-swatch-tile:hover {
  background: rgba(255, 248, 236, 0.065);
  transform: translateY(-2px);
}
.ls-swatch-tile.is-active {
  background: var(--hud-accent-bg);
  border-color: var(--hud-border-strong);
  box-shadow: 0 4px 14px rgba(216, 185, 142, 0.14);
}
.ls-swatch-tile:active { cursor: grabbing; transform: scale(0.95); }

.ls-swatch-chip {
  width: 48px;
  height: 48px;
  border-radius: var(--hud-radius-tile);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.36), inset 0 1px 1px rgba(255, 255, 255, 0.22);
  transition: transform 0.24s var(--hud-ease);
}
.ls-swatch-tile.is-active .ls-swatch-chip {
  transform: scale(1.03);
}

.ls-swatch-name {
  font-size: 10px;
  color: var(--hud-ink-soft);
  white-space: nowrap;
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ls-swatch-tile.is-active .ls-swatch-name {
  color: var(--hud-accent-bright);
  font-weight: 500;
}

/* Free Layout ("自由摆位") Toolbar */
.ls-stylist-strip {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.ls-stylist-strip.is-entering {
  animation: lsSwatchIn 0.28s var(--hud-ease) both;
}

.ls-stylist-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.ls-stylist-selected {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--hud-accent-bright);
}

.ls-stylist-hint {
  font-size: 10.5px;
  color: var(--hud-ink-soft);
  line-height: 1.38;
}

.ls-stylist-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.ls-stylist-actions .ls-subtle-btn {
  width: auto;
  min-height: 32px;
  padding: 0 13px;
}

/* Bottom Layer: "去哪看" (Decoupled Modes + 9 Cameras with Liquid Sliding Pills) */
.ls-nav-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 999px;
  max-width: calc(100vw - 24px);
  overflow-x: auto;
  scrollbar-width: none;
}
.ls-nav-bar::-webkit-scrollbar { display: none; }

.ls-nav-group {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.ls-nav-btn {
  position: relative;
  z-index: 1;
  height: 29px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--hud-ink-soft);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.24s var(--hud-ease), transform 0.18s var(--hud-ease);
}
.ls-nav-btn:hover { color: var(--hud-ink); }
.ls-nav-btn:active { transform: scale(0.95); }
.ls-nav-btn.is-active {
  color: var(--hud-accent-bright);
}

.ls-theme-card:active,
.ls-micro-pill:active,
.ls-subtle-btn:active:not(:disabled) {
  transform: scale(0.96);
}

@media (prefers-reduced-motion: reduce) {
  .ls-sliding-pill,
  .ls-edit-bar,
  .ls-swatch-rail.is-entering .ls-swatch-tile,
  .ls-stylist-strip.is-entering {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ---------- Pure 48×48px Cursor-Locked Drag Ghost (ZERO text card / ZERO tilt) ---------- */
.ls-drag-ghost {
  position: fixed;
  top: 0;
  left: 0;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  z-index: 95;
  pointer-events: none;
  opacity: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.42);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.48), inset 0 1px 1px rgba(255, 255, 255, 0.26);
  will-change: transform, opacity;
  transition: opacity 0.14s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.ls-drag-ghost.is-visible {
  opacity: 1;
}

.ls-drag-ghost.is-valid {
  border-color: var(--hud-accent-bright);
  box-shadow:
    0 0 0 2px rgba(242, 225, 196, 0.46),
    0 14px 32px rgba(0, 0, 0, 0.52);
}

/* ---------- Room-Scoped 3D Callout Pins (Settle-Gated 320ms Calm Fade) ---------- */
.ls-leader-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 15;
}

.ls-pin {
  position: fixed;
  transform: translate(-50%, -100%);
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 7px;
  border-radius: 999px;
  background: rgba(20, 18, 16, 0.74);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(216, 185, 142, 0.36);
  color: var(--hud-ink);
  font-size: 10.5px;
  white-space: nowrap;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.32s var(--hud-ease), border-color 0.22s ease;
}
.ls-pin.is-visible {
  opacity: 1;
  pointer-events: auto;
}
.ls-pin:hover { border-color: var(--hud-accent-bright); }

.ls-pin-dot {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  background: var(--hud-accent-bright);
  box-shadow: 0 0 8px rgba(216, 185, 142, 0.78);
}

/* ---------- sael.net-Style Direct 3D Furniture Hover, Floating Pill Toolbar & Warn Badge ---------- */
.ls-furn-hover {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 72;
  pointer-events: none;
  padding: 7px 12px;
  border-radius: 12px;
  background: rgba(20, 18, 17, 0.86);
  border: 1px solid rgba(244, 239, 230, 0.14);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.44);
  opacity: 0;
  transition: opacity 0.16s ease;
  max-width: 224px;
}
.ls-furn-hover.is-visible { opacity: 1; }
.ls-furn-hover-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--hud-ink);
  line-height: 1.3;
}
.ls-furn-hover-sub {
  font-size: 10.5px;
  color: var(--hud-ink-muted);
  margin-top: 2px;
  line-height: 1.3;
}

.ls-furn-toolbar {
  position: fixed;
  z-index: 78;
  transform: translate(-50%, -100%) scale(0.96);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 7px 5px 12px;
  border-radius: 999px;
  background: rgba(22, 19, 17, 0.90);
  border: 1px solid rgba(226, 200, 158, 0.34);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.50);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s var(--hud-ease), transform 0.22s var(--hud-ease);
}
.ls-furn-toolbar.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -100%) scale(1);
}
.ls-furn-tb-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--hud-ink);
  white-space: nowrap;
  padding-right: 4px;
}
.ls-furn-tb-sep {
  width: 1px;
  height: 14px;
  background: rgba(244, 239, 230, 0.16);
  margin: 0 2px;
}
.ls-furn-tb-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(255, 248, 236, 0.06);
  color: var(--hud-ink);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.18s var(--hud-ease);
}
.ls-furn-tb-btn svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ls-furn-tb-btn:hover,
.ls-furn-tb-btn.is-holding {
  background: var(--hud-accent-bg);
  border-color: var(--hud-border-strong);
  color: var(--hud-accent-bright);
}
.ls-furn-tb-btn.is-danger:hover {
  background: rgba(232, 108, 100, 0.18);
  border-color: rgba(245, 145, 138, 0.42);
  color: #ffb8b2;
}

@keyframes lsWarnShake {
  0%, 100% { transform: translate(-50%, -100%) translateX(0); }
  20% { transform: translate(-50%, -100%) translateX(-4px); }
  45% { transform: translate(-50%, -100%) translateX(4px); }
  70% { transform: translate(-50%, -100%) translateX(-2px); }
}

.ls-furn-warn {
  position: fixed;
  z-index: 80;
  transform: translate(-50%, -100%) scale(0.92);
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(34, 18, 18, 0.92);
  border: 1px solid rgba(242, 136, 128, 0.48);
  color: #ffc5bf;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.14s ease, transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.ls-furn-warn.is-visible {
  opacity: 1;
  transform: translate(-50%, -100%) scale(1);
  animation: lsWarnShake 0.28s ease-out;
}

.ls-stowed-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}
.ls-stowed-pill {
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(216, 185, 142, 0.32);
  background: rgba(216, 185, 142, 0.12);
  color: var(--hud-accent-bright);
  font-size: 10.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s var(--hud-ease);
}
.ls-stowed-pill:hover {
  background: rgba(216, 185, 142, 0.24);
  transform: translateY(-1px);
}

/* ---------- Toast & Perf Badge ---------- */
.ls-toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translate(-50%, -8px);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--hud-accent-bright);
  opacity: 0;
  pointer-events: none;
  z-index: 96;
  max-width: calc(100vw - 32px);
  text-align: center;
  transition: opacity 0.26s var(--hud-ease), transform 0.3s var(--hud-ease);
}
.ls-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.ls-perf {
  position: fixed;
  left: 20px;
  bottom: 18px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 10.5px;
  color: var(--hud-ink-soft);
  z-index: 35;
  display: none;
}

.ls-mobile-bar {
  display: none;
}

.ls-mobile-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--hud-ink);
  white-space: nowrap;
  cursor: pointer;
}

.ls-mobile-pill svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
}

.ls-mobile-pill.is-active {
  color: var(--hud-accent-bright);
  background: var(--hud-accent-bg);
  border-color: var(--hud-border-strong);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.36), 0 0 0 1px rgba(216, 185, 142, 0.22);
}

/* ---------- Mobile & Compact Viewport Polish (<= 760px, e.g. 390×844) ---------- */
@media (max-width: 760px) {
  .ls-topbar {
    top: calc(10px + env(safe-area-inset-top, 0px));
    left: 10px;
    right: 10px;
    gap: 8px;
  }

  .ls-mobile-bar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
  }

  .ls-brand {
    padding: 8px 12px;
  }

  .ls-brand-title {
    font-size: 11.5px;
    letter-spacing: 0.1em;
  }

  .ls-util-btn {
    min-height: 38px;
    min-width: 38px;
    padding: 0 9px;
    font-size: 11px;
  }

  .ls-util-more-btn {
    width: 38px;
  }

  .ls-zen-exit {
    top: 12px;
    right: 12px;
    min-height: 44px;
    padding: 0 18px;
  }

  .ls-rail {
    top: calc(56px + env(safe-area-inset-top, 0px));
    max-height: calc(100vh - 250px);
    z-index: 40;
  }
  .ls-rail-left,
  .ls-rail-right {
    left: 0;
    right: 0;
    margin: 0 auto;
    width: min(320px, calc(100vw - 24px));
    transform: none;
  }
  .ls-hud.is-collapsed .ls-rail-left,
  .ls-hud.is-collapsed .ls-rail-right {
    display: none;
  }
  .ls-hud.is-collapsed .ls-rail-left.is-mobile-open,
  .ls-hud.is-collapsed .ls-rail-right.is-mobile-open {
    display: block;
    animation: lsSwatchIn 0.22s var(--hud-ease) both;
  }

  .ls-dock-wrap {
    left: 10px;
    right: 10px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    gap: 10px;
  }

  .ls-edit-bar {
    width: 100%;
    max-width: 100%;
    padding: 10px 12px 11px;
    gap: 10px;
    border-radius: 18px;
  }

  .ls-tab-strip {
    justify-content: flex-start;
    gap: 8px;
    padding: 1px 10px 1px 2px;
    -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 90%, transparent 100%);
    mask-image: linear-gradient(90deg, #000 0%, #000 90%, transparent 100%);
  }

  .ls-hud .ls-slot-tab,
  .ls-hud .ls-undo-pill,
  .ls-hud .ls-redo-pill {
    min-height: 32px;
    height: 32px;
    padding: 0 13px;
    font-size: 11.5px;
  }

  .ls-edit-body {
    min-height: 68px;
  }

  .ls-swatch-rail {
    justify-content: flex-start;
    gap: 10px;
    padding: 2px 10px 2px 2px;
    -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 92%, transparent 100%);
    mask-image: linear-gradient(90deg, #000 0%, #000 92%, transparent 100%);
  }

  .ls-swatch-tile {
    width: 60px;
    gap: 6px;
    padding: 4px 2px;
  }

  .ls-swatch-chip {
    width: 44px;
    height: 44px;
  }

  .ls-swatch-name {
    font-size: 10.5px;
    max-width: 58px;
  }

  .ls-nav-bar {
    max-width: 100%;
    padding: 5px 10px;
  }

  .ls-nav-group {
    gap: 8px;
    padding-right: 6px;
  }

  .ls-hud .ls-nav-btn {
    min-height: 34px;
    height: 34px;
    padding: 0 13px;
    font-size: 12px;
  }

  .ls-furn-toolbar {
    max-width: calc(100vw - 16px);
    padding: 5px 6px 5px 10px;
    gap: 4px;
  }

  .ls-furn-tb-name {
    max-width: 112px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
  }

  .ls-furn-tb-btn {
    height: 34px;
    padding: 0 11px;
    font-size: 12px;
  }

  .ls-stylist-actions .ls-subtle-btn {
    min-height: 38px;
  }
}

@media (max-width: 480px) {
  .ls-hud .ls-topbar {
    justify-content: center;
  }
}

/* ---------- Tactile Procedural Material Thumbnail Swatches ---------- */
.swatch-oak { background: repeating-linear-gradient(12deg, #c79f6d 0 8px, #b48a59 8px 14px, #cfa97a 14px 18px); }
.swatch-whiteOak { background: repeating-linear-gradient(12deg, #ded0bc 0 9px, #cbbba4 9px 15px, #e6dac8 15px 20px); }
.swatch-walnut { background: repeating-linear-gradient(12deg, #6e482e 0 8px, #53341f 8px 14px, #7b5236 14px 18px); }
.swatch-ebony { background: repeating-linear-gradient(12deg, #3c3430 0 8px, #292320 8px 14px, #473e3a 14px 18px); }
.swatch-stone { background: radial-gradient(circle at 30% 30%, #e4ded3, #c6bfb2); }
.swatch-calacatta { background: linear-gradient(135deg, #f3f0ea 0%, #dedad2 45%, #f5f2ec 55%, #cfc9be 100%); }
.swatch-terrazzo { background: radial-gradient(circle at 25% 30%, #8c7b6b 2px, transparent 3px), radial-gradient(circle at 70% 65%, #a87b5b 2.5px, transparent 3.5px), radial-gradient(circle at 50% 20%, #5c5854 1.5px, transparent 2.5px), #dfd9ce; }
.swatch-slate { background: linear-gradient(160deg, #5c5b5a, #3e3e40); }
.swatch-sand { background: radial-gradient(circle at 35% 30%, #efe7da, #dcd2c0); }
.swatch-cream { background: radial-gradient(circle at 35% 30%, #f8f4ec, #e8e1d4); }
.swatch-clay { background: radial-gradient(circle at 32% 28%, #d89d7d, #b27556); }
.swatch-inkBlue { background: radial-gradient(circle at 30% 25%, #3b536e, #223347); }
.swatch-sage { background: radial-gradient(circle at 30% 25%, #9eab94, #7a8870); }
.swatch-graphite { background: radial-gradient(circle at 30% 25%, #55595f, #35383d); }
.swatch-boucle { background: radial-gradient(circle at 30% 30%, #f0e9dc 1px, #dcd3c4 2px); background-size: 6px 6px; }
.swatch-cognac { background: radial-gradient(circle at 35% 30%, #b46c40, #844825); }
.swatch-navyVelvet { background: radial-gradient(circle at 30% 25%, #3a5170, #203047); }
.swatch-greyWool { background: radial-gradient(circle at 30% 30%, #928e89 1px, #726e6a 2px); background-size: 5px 5px; }
.swatch-sageLinen { background: radial-gradient(circle at 30% 30%, #97a68d, #74846b); }
.swatch-terracottaLinen { background: radial-gradient(circle at 30% 30%, #c47a5b, #9c583c); }
.swatch-oatKnit { background: repeating-linear-gradient(0deg, #e2d9ca 0 3px, #cdc2b0 3px 6px); }
.swatch-charcoalFelt { background: radial-gradient(circle at 30% 30%, #4e5056, #323438); }
.swatch-terracottaWeave { background: repeating-linear-gradient(0deg, #ba6e50 0 4px, #9a553a 4px 7px); }
