/* 60-30-10 Interior Palette Builder — room preview driven by role-mapped
   CSS custom properties (spec 15). Surfaces: wall = 60% dominant,
   furniture = 30% main, textiles = 10% accent, decor = anchor/support. */

.pct-interior-layout {
  grid-template-columns: minmax(280px, 360px) 1fr;
  grid-template-areas:
    "form preview"
    "form result";
}

.pct-interior-layout .paletier-tool-form { grid-area: form; }
.pct-interior-layout .pct-room-preview { grid-area: preview; }
.pct-interior-layout .paletier-tool-result { grid-area: result; min-height: 0; }

.pct-room-preview {
  padding: 16px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.pct-room-scene {
  min-height: 280px;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: var(--pct-room-bg, #e8e3d5);
  border: 1px solid rgba(0,0,0,.06);
}

.pct-room-scene span { position: absolute; display: block; transition: background .35s ease, border-color .35s ease; }

.pct-room-scene .wall   { inset: 0; background: var(--pct-room-bg, #e8e3d5); }
.pct-room-scene .window { right: 8%; top: 10%; width: 16%; height: 34%; border-radius: 8px 8px 0 0; background: linear-gradient(180deg, #f4f1e8, #e6e0d2); border: 5px solid var(--pct-room-support, #ddd3c0); }
.pct-room-scene .art    { left: 12%; top: 12%; width: 22%; height: 28%; border: 6px solid var(--pct-room-anchor, #30473a); background: var(--pct-room-support, #ddd3c0); }
.pct-room-scene .lamp   { right: 30%; top: 16%; width: 9%; height: 30%; border-radius: 999px 999px 0 0; background: var(--pct-room-accent, #c77f4f); opacity: .9; }
.pct-room-scene .sofa   { left: 10%; bottom: 20%; width: 46%; height: 24%; border-radius: 12px 12px 6px 6px; background: var(--pct-room-main, #9caf88); }
.pct-room-scene .pillow { bottom: 35%; width: 12%; height: 10%; border-radius: 7px; }
.pct-room-scene .pillow.one { left: 14%; background: var(--pct-room-accent, #c77f4f); }
.pct-room-scene .pillow.two { left: 29%; background: var(--pct-room-support, #ddd3c0); }
.pct-room-scene .table  { right: 12%; bottom: 18%; width: 17%; height: 17%; border-radius: 6px; background: var(--pct-room-anchor, #30473a); }
.pct-room-scene .rug    { left: 18%; bottom: 7%; width: 52%; height: 8%; border-radius: 999px; background: var(--pct-room-main, #9caf88); opacity: .45; }

.pct-ratio-bar {
  display: flex;
  height: 46px;
  border-radius: 8px;
  overflow: hidden;
  color: #fff;
  font-weight: 800;
  border: 1px solid rgba(0,0,0,.08);
}

.pct-ratio-bar i {
  display: grid;
  place-items: center;
  font-style: normal;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13px;
  text-shadow: 0 1px 2px rgba(0,0,0,.28);
  transition: background .35s ease;
}

.pct-ratio-bar .dominant  { flex: 6; background: var(--pct-room-bg, #e8e3d5); color: #3a382f; text-shadow: none; }
.pct-ratio-bar .secondary { flex: 3; background: var(--pct-room-main, #9caf88); }
.pct-ratio-bar .accent    { flex: 1; background: var(--pct-room-accent, #c77f4f); }

.pct-surface-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  font-size: 12.5px;
  color: var(--pct-muted);
}

.pct-surface-legend li { display: flex; align-items: center; gap: 8px; }

.pct-surface-legend .dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,.12);
  flex: none;
}

.pct-surface-legend .wall-dot      { background: var(--pct-room-bg, #e8e3d5); }
.pct-surface-legend .furniture-dot { background: var(--pct-room-main, #9caf88); }
.pct-surface-legend .textile-dot   { background: var(--pct-room-accent, #c77f4f); }
.pct-surface-legend .decor-dot     { background: var(--pct-room-anchor, #30473a); }

@media (max-width: 1024px) {
  .pct-interior-layout {
    grid-template-columns: 1fr;
    grid-template-areas: "form" "preview" "result";
  }
}

@media (max-width: 640px) {
  .pct-room-preview {
    padding: 14px;
  }

  .pct-room-scene {
    min-height: 210px;
  }

  .pct-ratio-bar {
    height: auto;
    min-height: 52px;
  }

  .pct-ratio-bar i {
    min-height: 52px;
    padding: 6px 4px;
    font-size: 11px;
    overflow-wrap: anywhere;
  }

  .pct-surface-legend {
    grid-template-columns: 1fr;
  }
}
