/* =========================================================
   Design Your Own House — page styles
   ========================================================= */

.hd-hero { padding-bottom: 0.5rem; }

.hd-app {
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
  padding: 0 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ---------- buttons ---------- */
.hd-btn {
  font: 500 0.85rem 'Rubik', sans-serif;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  white-space: nowrap;
}
.hd-btn:hover { border-color: var(--neon-cyan); }
.hd-btn:active { transform: translateY(1px); }
.hd-btn:disabled { opacity: 0.4; cursor: default; border-color: var(--border); }
.hd-btn.active { background: var(--neon-cyan); color: #0b0e14; border-color: var(--neon-cyan); }
.hd-btn.danger:hover { border-color: #ff5a5a; color: #ff8a8a; }
.hd-btn.sm { padding: 0.3rem 0.55rem; font-size: 1rem; line-height: 1; }

.hd-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem;
}
.hd-group-btns { display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* ---------- main 3-column layout ---------- */
.hd-main {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 300px;
  gap: 0.75rem;
  height: min(78vh, 860px);
  min-height: 520px;
}

.hd-palette, .hd-inspector {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  overflow-y: auto;
  scrollbar-width: thin;
}

.hd-tabs { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0.6rem 0; }
.hd-tab {
  font: 500 0.78rem 'Rubik', sans-serif;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  cursor: pointer;
}
.hd-tab:hover { color: var(--text); }
.hd-tab.active { color: #0b0e14; background: var(--neon-magenta); border-color: var(--neon-magenta); }

.hd-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem; }
.hd-tool {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-align: left;
  font: 500 0.78rem 'Rubik', sans-serif;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.45rem 0.5rem;
  cursor: pointer;
  line-height: 1.2;
}
.hd-tool .e { font-size: 1.15rem; flex: none; }
.hd-tool:hover { border-color: var(--neon-cyan); }
.hd-tool.active { border-color: var(--neon-cyan); background: rgba(0, 245, 212, 0.14); box-shadow: 0 0 0 1px var(--neon-cyan) inset; }
.hd-select { width: 100%; font-size: 0.9rem; padding: 0.55rem; }

.hd-group { font: 700 0.72rem 'Rubik', sans-serif; text-transform: uppercase; letter-spacing: 0.08em; color: var(--neon-cyan); margin: 0.9rem 0 0.4rem; }
.hd-small { color: var(--text-dim); font-size: 0.78rem; margin: 0.3rem 0 0.5rem; }

/* ---------- views ---------- */
.hd-views {
  position: relative;
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 0.75rem;
  min-height: 0;
}
.hd-views[data-view="plan"] { grid-template-rows: 1fr; }
.hd-views[data-view="plan"] .hd-3d { display: none; }
.hd-views[data-view="3d"] { grid-template-rows: 1fr; }
.hd-views[data-view="3d"] .hd-plan { display: none; }

.hd-plan, .hd-3d {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 0;
  background: #0d1220;
}
.hd-plan canvas { display: block; touch-action: none; }
#view3d { position: absolute; inset: 0; touch-action: none; }
#view3d canvas { display: block; }

.hd-overlay { position: absolute; display: flex; gap: 0.35rem; align-items: center; flex-wrap: wrap; z-index: 2; }
.hd-tl { top: 0.6rem; left: 0.6rem; right: 4.5rem; }
.hd-tr { top: 0.6rem; right: 0.6rem; flex-direction: column; }
.hd-zoom { top: 4rem; }

.hd-floorbar { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.hd-chip {
  font: 500 0.78rem 'Rubik', sans-serif;
  color: var(--text);
  background: rgba(19, 24, 38, 0.9);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
}
.hd-chip.active { background: var(--neon-purple); border-color: var(--neon-purple); color: #0b0e14; }
.hd-chip.ghost { color: var(--neon-cyan); border-style: dashed; }

.hd-hint {
  position: absolute;
  left: 50%;
  bottom: 0.6rem;
  transform: translateX(-50%);
  max-width: calc(100% - 9rem);
  font-size: 0.78rem;
  color: var(--text);
  background: rgba(11, 14, 20, 0.85);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.35rem 0.7rem;
  text-align: center;
  pointer-events: none;
}

.hd-3dbar select, .hd-field select, .hd-field input[type="text"], .hd-field input[type="number"], .hd-floor-row input[type="text"] {
  font: 500 0.82rem 'Rubik', sans-serif;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.5rem;
  width: 100%;
}
.hd-3dbar select { width: auto; background: rgba(19, 24, 38, 0.92); }
.hd-time {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.8rem; font-weight: 500;
  background: rgba(19, 24, 38, 0.92);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.25rem 0.5rem;
}
.hd-time input { width: 120px; accent-color: var(--neon-yellow); }
.hd-check { display: flex; align-items: center; gap: 0.45rem; font-size: 0.85rem; margin: 0.45rem 0; cursor: pointer; }
.hd-check input { accent-color: var(--neon-cyan); width: 1rem; height: 1rem; }
.hd-check.sm { margin: 0; background: rgba(19, 24, 38, 0.92); border: 1px solid var(--border); border-radius: 8px; padding: 0.3rem 0.5rem; font-size: 0.8rem; }

.hd-walkpad { position: absolute; right: 0.8rem; bottom: 0.8rem; display: flex; flex-direction: column; align-items: center; gap: 0.3rem; z-index: 2; }
.hd-walkpad[hidden] { display: none; }
.hd-walkpad div { display: flex; gap: 0.3rem; }
.hd-walkpad .hd-btn { width: 3rem; height: 3rem; font-size: 1.1rem; background: rgba(19, 24, 38, 0.9); touch-action: none; }
.hd-lightnote { position: absolute; left: 0.6rem; bottom: 0.5rem; font-size: 0.72rem; color: var(--text-dim); z-index: 2; }

/* ---------- inspector ---------- */
.hd-inspector h3 { font-size: 0.8rem; margin: 0 0 0.3rem; color: var(--neon-yellow); }
.hd-field { display: flex; flex-direction: column; gap: 0.3rem; margin: 0.6rem 0; flex: 1; min-width: 0; }
.hd-label { font-size: 0.78rem; color: var(--text-dim); font-weight: 500; }
.hd-help { font-size: 0.72rem; color: var(--text-dim); opacity: 0.85; }
.hd-row { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.hd-row .hd-btn { flex: 1; }
.hd-colour { display: flex; flex-direction: column; gap: 0.4rem; }
.hd-swatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.hd-swatch { aspect-ratio: 1; border-radius: 6px; border: 2px solid rgba(255, 255, 255, 0.12); cursor: pointer; padding: 0; }
.hd-swatch:hover { transform: scale(1.12); }
.hd-swatch.on { border-color: var(--neon-cyan); box-shadow: 0 0 0 2px #0b0e14 inset; }
.hd-colour input[type="color"] { width: 100%; height: 30px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-card); padding: 2px; cursor: pointer; }
.hd-range { display: flex; align-items: center; gap: 0.5rem; }
.hd-range input { flex: 1; accent-color: var(--neon-magenta); min-width: 0; }
.hd-range output { font-size: 0.78rem; min-width: 4.2rem; text-align: right; color: var(--neon-cyan); }
.hd-floor-row { display: grid; gap: 0.3rem; margin-bottom: 0.6rem; }
.hd-fact { font-size: 0.78rem; background: rgba(255, 214, 10, 0.08); border: 1px solid rgba(255, 214, 10, 0.35); border-radius: 10px; padding: 0.5rem 0.6rem; margin: 0.4rem 0; }
.hd-temps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.hd-temp {
  font: 600 0.72rem 'Rubik', sans-serif;
  color: #0b0e14;
  background: var(--tc);
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 0.3rem 0.2rem;
  cursor: pointer;
  line-height: 1.15;
}
.hd-temp small { font-weight: 400; font-size: 0.62rem; }
.hd-temp.on { border-color: var(--neon-magenta); box-shadow: 0 0 10px var(--tc); }

/* ---------- info panel ---------- */
.hd-info {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.25rem 1rem 1rem;
}
.hd-cu { background: #e9e7e3; color: #0b0e14; border-radius: 12px; padding: 0.6rem; margin: 0.5rem 0 1rem; overflow-x: auto; }
.hd-cu-title { font: 700 0.75rem 'Rubik', sans-serif; margin-bottom: 0.5rem; }
.hd-cu-row { display: flex; gap: 3px; min-width: max-content; }
.hd-mcb { width: 56px; background: #fff; border: 1px solid #bbb; border-radius: 4px; padding: 6px 3px; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.hd-mcb.main { width: 72px; background: #1f2c46; color: #fff; }
.hd-mcb.spd { background: #dfe7ef; }
.hd-mcb-sw { width: 14px; height: 24px; background: #3b3f45; border-radius: 3px; box-shadow: inset 0 -10px 0 #6b6f78; }
.hd-mcb.main .hd-mcb-sw { background: #d9483b; box-shadow: inset 0 -10px 0 #a3342a; }
.hd-mcb-lbl { font-size: 0.6rem; text-align: center; line-height: 1.15; }
.hd-cols { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1rem; }
.hd-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.hd-table th { text-align: left; color: var(--neon-cyan); font-weight: 500; border-bottom: 1px solid var(--border); padding: 0.4rem; }
.hd-table td { border-bottom: 1px solid var(--border); padding: 0.4rem; vertical-align: top; }
.hd-score { font-weight: 700; margin: 0 0 0.4rem; }
.hd-checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.3rem; font-size: 0.8rem; max-height: 320px; overflow-y: auto; }
.hd-checks li { padding: 0.35rem 0.5rem; border-radius: 8px; background: var(--bg-card); border-left: 3px solid var(--neon-green); }
.hd-checks li.warn { border-left-color: var(--neon-yellow); }
.hd-checks li.bad { border-left-color: #ff5a5a; background: rgba(255, 90, 90, 0.08); }
.hd-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.5rem; margin: 0.5rem 0 1rem; }
.hd-stats div { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 0.6rem; display: flex; flex-direction: column; }
.hd-stats b { font-size: 1.3rem; color: var(--neon-cyan); }
.hd-stats span { font-size: 0.75rem; color: var(--text-dim); }
.hd-shopgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 1.2rem; }
.hd-shop { list-style: none; padding: 0; margin: 0; font-size: 0.82rem; }
.hd-shop li { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.25rem 0; border-bottom: 1px dashed var(--border); }
.hd-shop .dot { display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 50%; margin-right: 0.4rem; vertical-align: -1px; border: 1px solid rgba(255, 255, 255, 0.3); }

.hd-keys { font-size: 0.75rem; color: var(--text-dim); text-align: center; margin: 0; }
.hd-keys kbd { font: 600 0.7rem 'Rubik', sans-serif; background: var(--bg-card); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; padding: 0 0.3rem; }

.hd-toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translate(-50%, 150%);
  background: var(--bg-card);
  border: 1px solid var(--neon-cyan);
  color: var(--text);
  border-radius: 12px;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  z-index: 50;
  transition: transform 0.25s, opacity 0.25s, visibility 0.25s;
  opacity: 0;
  visibility: hidden;
  max-width: calc(100% - 2rem);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.hd-toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }

/* ---------- smaller screens ---------- */
@media (max-width: 1150px) {
  .hd-main { grid-template-columns: 220px minmax(0, 1fr); height: auto; }
  .hd-views { height: 70vh; min-height: 460px; }
  .hd-palette { max-height: 70vh; }
  .hd-inspector { grid-column: 1 / -1; max-height: none; }
}
@media (max-width: 800px) {
  .hd-app { padding: 0 0.5rem 1rem; }
  .hd-main { grid-template-columns: 1fr; }
  .hd-views { order: -1; }
  .hd-palette { max-height: 260px; }
  .hd-tools { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .hd-views { height: 72vh; }
  .hd-cols { grid-template-columns: 1fr; }
  .hd-hint { max-width: calc(100% - 1.2rem); bottom: 0.4rem; font-size: 0.72rem; }
  .hd-time input { width: 80px; }
  .hd-toolbar { justify-content: center; }
}
