/* floorplan3d: tokens first, so a host skin can override them on .fp or any parent */
.fp {
  --fp-bg: #14161a;
  --fp-text: #e9e6df;
  --fp-muted: #b9bcc1;
  --fp-line: #e9e6df;
  --fp-wall: #efebe4;
  --fp-cap: #2a2d33;
  --fp-glass: #cfe3ef;
  --fp-accent: #b8735a;
  --fp-floor-hall: #f1ede6;
  --fp-floor-closet: #efeae0;
  --fp-floor-bath: #e4e9ee;
  --fp-floor-living: #f0e4d8;
  --fp-floor-kitchen: #e9eef0;
  --fp-floor-bed: #ece5ea;
  --fp-floor-deck: #6f655a;
  /* furniture colours (palette from the design bible: oak, warm white, charcoal sofa, rust throw, oatmeal bedding) */
  --fp-furn-fabric: #45484e;
  --fp-furn-fabric2: #55585f;
  --fp-furn-rust: #a65a3c;
  --fp-furn-linen: #c9bcaa;
  --fp-furn-bedding: #e8e1d5;
  --fp-furn-duvet: #ddd3c3;
  --fp-furn-pillow: #f3eee6;
  --fp-furn-oak: #b48c5f;
  --fp-furn-walnut: #6e4b33;
  --fp-furn-white: #f5f3ef;
  --fp-furn-white2: #e4dfd6;
  --fp-furn-metal: #26282c;
  --fp-furn-screen: #121316;
  --fp-furn-rug: #bdb5a8;

  position: relative;
  background: var(--fp-bg);
  color: var(--fp-text);
  font-family: Inter, system-ui, sans-serif;
  border-radius: 14px;
  overflow: hidden;
}
.fp [hidden] { display: none !important; }   /* a display rule must never beat the hidden attribute (QA-LOG P18) */
.fp-main { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); }
.fp-stage { position: relative; width: 100%; aspect-ratio: 16 / 10; min-width: 0; }
.fp-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; outline: none; }
.fp-canvas:active { cursor: grabbing; }
.fp-canvas:focus-visible { box-shadow: inset 0 0 0 3px var(--fp-accent); }
.fp-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.fp-label {
  position: absolute; left: 0; top: 0;
  font-size: 13px; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap;
  color: #1d2025; background: rgb(255 255 255 / 0.82);
  padding: 3px 8px; border-radius: 999px;
  opacity: 0; will-change: transform;
}
.fp-label--out { color: var(--fp-text); background: rgb(20 22 26 / 0.7); }
.fp-honest {
  position: absolute; left: 16px; bottom: 12px; margin: 0;
  font-size: 12px; color: var(--fp-muted); pointer-events: none;
}
.fp-note {
  position: absolute; left: 16px; top: 12px; margin: 0; max-width: calc(100% - 32px);
  font-size: 12px; color: var(--fp-text); background: rgb(20 22 26 / 0.8);
  padding: 6px 10px; border-radius: 8px;
}

/* side panel (desktop) / bottom sheet (phone) */
.fp-panel {
  padding: 20px; border-top: 1px solid rgb(255 255 255 / 0.08);
  background: var(--fp-panel, #1b1d22);
}
.fp-panel-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.fp-panel-title { margin: 0 0 10px; font-size: 18px; font-weight: 600; line-height: 1.3; }
.fp-panel-text { margin: 12px 0 0; font-size: 14px; line-height: 1.55; color: var(--fp-muted); }
.fp-badge {
  display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
  padding: 4px 10px; border-radius: 999px; border: 1px solid currentColor;
}
.fp-badge--visas { color: #9fcfa8; }
.fp-badge--saknas { color: #e4b07a; }
.fp-close {
  font: inherit; font-size: 13px; color: var(--fp-text); background: transparent;
  border: 1px solid rgb(255 255 255 / 0.22); border-radius: 999px; padding: 6px 12px; min-height: 36px; cursor: pointer;
}

/* bar: chips on the left, view tools on the right */
.fp-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
  padding: 12px 16px; border-top: 1px solid rgb(255 255 255 / 0.08);
}
.fp-chips, .fp-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fp-btn, .fp-chip, .fp-seg-btn {
  font: inherit; font-size: 14px; color: var(--fp-text);
  background: transparent; border: 1px solid rgb(255 255 255 / 0.22); border-radius: 999px;
  padding: 8px 16px; min-height: 40px; cursor: pointer;
}
.fp-chip[aria-pressed="true"] { background: var(--fp-accent); border-color: var(--fp-accent); color: #fff; }
.fp-seg { display: inline-flex; border: 1px solid rgb(255 255 255 / 0.22); border-radius: 999px; padding: 2px; }
.fp-seg-btn { border: 0; min-height: 36px; padding: 6px 14px; }
.fp-seg-btn[aria-pressed="true"] { background: var(--fp-text); color: var(--fp-bg); }
.fp-btn[hidden] { display: none; }
@media (hover: hover) {
  .fp-btn:hover, .fp-chip:hover, .fp-close:hover { border-color: rgb(255 255 255 / 0.5); }
}
.fp-btn:focus-visible, .fp-chip:focus-visible, .fp-seg-btn:focus-visible, .fp-close:focus-visible {
  outline: 2px solid var(--fp-accent); outline-offset: 2px;
}

@media (min-width: 900px) {
  .fp-main { grid-template-columns: minmax(0, 1fr) 300px; }
  .fp-panel { border-top: 0; border-left: 1px solid rgb(255 255 255 / 0.08); }
}
@media (max-width: 767px) {
  .fp-stage { aspect-ratio: 1 / 1; }   /* 4:5 left a third of the stage empty around this wide plan (QA-LOG P21) */
  .fp-label { font-size: 12px; padding: 2px 7px; }
  /* bottom sheet over the lower part of the plan; slides in when a chip is chosen */
  .fp-panel {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
    border-radius: 16px 16px 0 0; box-shadow: 0 -8px 24px rgb(0 0 0 / 0.35);
    transform: translateY(100%); visibility: hidden;
    transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s linear 300ms;
  }
  .fp-panel.is-open { transform: none; visibility: visible; transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1); }
  .fp-bar { padding: 12px; }
  .fp-chips { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .fp-panel, .fp-panel.is-open { transition: none; }
}
