/* Projektant domku (#domek, web/house.js) */
#p-domek { width: min(1800px, calc(100vw - 32px)); position: relative; left: 50%; transform: translateX(-50%); }
.hd { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 14px; align-items: start; }
.hd-side { display: flex; flex-direction: column; gap: 10px; }
.hd-box { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.hd-box h4 { margin: 0; font-size: 14px; color: var(--gold); }
.hd-box .m, .hd .m { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.hd-box select, .hd-box input, .hd-cat input { width: 100%; background: var(--card2); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.hd-designs, .hd-hlist { display: flex; flex-direction: column; gap: 4px; }
.hd-hlist { max-height: 300px; overflow-y: auto; }
.hd-designs button, .hd-hlist button { display: flex; flex-direction: column; align-items: flex-start; text-align: left; background: var(--card2);
  border: 1px solid var(--line); color: var(--ink); border-radius: 8px; padding: 5px 8px; cursor: pointer; font-size: 13px; }
.hd-designs button small, .hd-hlist button small { color: var(--muted); font-size: 11.5px; }
.hd-designs button.on, .hd-hlist button.on { border-color: var(--gold); }
.hd-designs button.add { flex-direction: row; gap: 6px; align-items: center; color: var(--gold); }
.hd-shot { margin: 4px 0 0; }
.hd-shot img { width: 100%; border-radius: 6px; cursor: zoom-in; image-rendering: auto; }
.hd-shot figcaption { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: var(--muted); margin-top: 4px; }
.hd-mini { width: 100px; height: 100px; image-rendering: pixelated; border-radius: 6px; border: 1px solid var(--line); }
.hd-lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 1000; display: grid; place-items: center; cursor: zoom-out; }
.hd-lightbox img { max-width: 94vw; max-height: 92vh; image-rendering: auto; }

.hd-main { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.hd-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.hd-head .nm { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 3px; }
.hd-head .nm input { background: var(--card2); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; width: 240px; }
.hd-head .btns { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.hd-head .msg { color: var(--muted); font-size: 13px; }
.hd-bar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.hd-levels, .hd-tools, .hd-view { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.hd-tools .mini.on { border-color: var(--gold); color: var(--gold); }
.hd-view input[type=number] { width: 54px; background: var(--card2); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 3px 5px; }
.hd-view select { background: var(--card2); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 3px 5px; }
.hd-row { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 12px; align-items: start; }
.hd-stagebox { overflow: auto; max-height: 78vh; background: #07080a; border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.hd-stage { position: relative; background: #000; touch-action: none; user-select: none; cursor: crosshair; margin: auto; }
.hd-stage.gl { background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: var(--t) var(--t); }
.hd-night { position: absolute; left: 0; top: 0; z-index: 99990; pointer-events: none; display: none; }
.hd-real { color: var(--sell); font-style: normal; font-size: 10px; }
.hd-houseimg { position: absolute; z-index: 1; background-size: 100% 100%; background-repeat: no-repeat; image-rendering: pixelated; pointer-events: none; }
.hd-mapclip { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.hd-map { position: absolute; background-repeat: no-repeat; image-rendering: pixelated; opacity: .8; }
.hd-stage.nomap .hd-mapclip { display: none; }
.hd-bgclip { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.hd-shot-bg { position: absolute; max-width: none; image-rendering: auto; }
.hd-stage.noshot .hd-bgclip { display: none; }
.hd-stage.bgtool { cursor: move; }
.hd-gridov { position: absolute; inset: 0; pointer-events: none; display: none;
  background-image: linear-gradient(rgba(255,255,255,.22) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.22) 1px, transparent 1px);
  background-size: var(--t) var(--t); }
.hd-stage.gl .hd-gridov { display: block; }
.hd-bgbar { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.hd-bgbar:empty { display: none; }
.hd-bgbar select, .hd-bgbar input[type=number] { background: var(--card2); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 3px 5px; }
.hd-bgbar input[type=number] { width: 70px; }
.hd-bgbar input[type=range] { vertical-align: middle; width: 110px; }
.hd-bgbar .mini.on { border-color: var(--gold); color: var(--gold); }
.hd-arrows { display: inline-flex; gap: 2px; }
.hd-door { position: absolute; width: var(--t); height: var(--t); outline: 2px dashed #ff4fd8; outline-offset: -2px; z-index: 5; }
.hd-hint { margin-top: 6px; padding: 8px 10px; border: 1px solid var(--gold); border-radius: 8px; background: rgba(229,180,83,.08); }
.hd-stage .hf { z-index: 1; position: absolute; width: var(--t); height: var(--t); background-repeat: no-repeat; image-rendering: pixelated; }
.hd-stage.gl .hf::after { content: ""; position: absolute; inset: 0; border-right: 1px solid rgba(0,0,0,.18); border-bottom: 1px solid rgba(0,0,0,.18); pointer-events: none; }
.hd-stage .hf.ghost { background: rgba(229,180,83,.08); outline: 1px dashed rgba(229,180,83,.25); outline-offset: -1px; }
.hd-stage .ho { position: absolute; width: var(--t); height: var(--t); pointer-events: none; }
.hd-stage .ho.wp { background-repeat: no-repeat; image-rendering: pixelated; }
.hd-stage .ho img, .hd-ghost img { position: absolute; right: 0; bottom: 0; image-rendering: pixelated; max-width: none; }
.hd-stage .ho img.flip { transform: scaleX(-1); }
.hd-ghost { position: absolute; width: var(--t); height: var(--t); display: none; z-index: 99999; pointer-events: none; outline: 2px solid rgba(229,180,83,.8); outline-offset: -2px; }
.hd-ghost img { opacity: .6; }
.hd-ghost.no { outline-color: rgba(220,60,60,.95); background: rgba(220,60,60,.25); }
.hd-ghost.no img { opacity: .35; filter: grayscale(1); }
/* styl „wygładzony” (#hd-root.hd-smooth, grafiki z /static/hd/ - tools/upscale_house.py): bez pikseli, cienie mebli, winieta */
.hd-smooth .hd-houseimg, .hd-smooth .hd-stage .hf, .hd-smooth .hd-stage .ho.wp, .hd-smooth .hd-stage .ho img,
.hd-smooth .hd-ghost img, .hd-smooth .hd-it img { image-rendering: auto; }
.hd-smooth .hd-stage .ho:not(.wl):not(.cp):not(.tg) img { filter: drop-shadow(3px 3px 2.5px rgba(10, 8, 5, .45)); }
.hd-smooth .hd-stage::after { content: ""; position: absolute; inset: 0; z-index: 99980; pointer-events: none;
  background: radial-gradient(ellipse at 50% 50%, rgba(8, 9, 12, 0) 60%, rgba(8, 9, 12, .4) 100%); }
.hd-rect { position: absolute; display: none; z-index: 99998; pointer-events: none; background: rgba(229,180,83,.18); outline: 2px dashed var(--gold); }
.hd-status { font-size: 13px; color: var(--ink); }

.hd-cat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; max-height: 82vh; }
.hd-groups { display: flex; flex-wrap: wrap; gap: 4px; }
.hd-groups .tab { padding: 3px 9px; font-size: 12.5px; }
.hd-sel { font-size: 12.5px; color: var(--muted); }
.hd-sel b { color: var(--ink); }
.hd-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 4px; overflow-y: auto; min-height: 120px; }
.hd-it { display: flex; flex-direction: column; align-items: center; gap: 2px; background: var(--card2); border: 1px solid var(--line); border-radius: 8px;
  padding: 4px 2px; cursor: pointer; color: var(--ink); }
.hd-it img { width: 48px; height: 48px; object-fit: contain; image-rendering: pixelated; }
.hd-it span { font-size: 10.5px; line-height: 1.15; max-height: 2.3em; overflow: hidden; text-align: center; word-break: break-word; }
.hd-it.on { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }

@media (max-width: 1200px) { .hd-row { grid-template-columns: 1fr; } .hd-cat { max-height: 60vh; } }
@media (max-width: 860px) { .hd { grid-template-columns: 1fr; } }
