* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; font: 14px/1.4 system-ui, "Segoe UI", sans-serif; color: #1d232b; background: #cfe3f2; }
canvas { display: block; }
button, select { font: inherit; border: 1px solid #c3ccd6; background: #fff; border-radius: 7px; padding: 5px 10px; cursor: pointer; color: inherit; }
button:hover { background: #eef3f8; }
button.aktiv { background: #2f6db5; border-color: #2f6db5; color: #fff; }

#topp { position: fixed; top: 0; left: 0; right: 0; z-index: 10; display: flex; align-items: center; gap: 12px; padding: 8px 12px;
  background: rgba(255,255,255,.92); border-bottom: 1px solid #d6dde5; backdrop-filter: blur(6px); flex-wrap: wrap; }
#topp .titel { font-weight: 700; font-size: 16px; }
#topp .grupp { display: flex; gap: 0; }
#topp .grupp button { border-radius: 0; margin-left: -1px; }
#topp .grupp button:first-child { border-radius: 7px 0 0 7px; margin-left: 0; }
#topp .grupp button:last-child { border-radius: 0 7px 7px 0; }
#topp .hoger { margin-left: auto; display: flex; gap: 6px; }

#mobelpanel { position: fixed; left: 12px; top: 64px; z-index: 9; width: 250px; max-height: calc(100% - 80px); overflow: auto;
  background: rgba(255,255,255,.94); border: 1px solid #d6dde5; border-radius: 10px; padding: 10px; box-shadow: 0 4px 16px rgba(0,0,0,.08); }
#mobelpanel h2 { margin: 0 0 6px; font-size: 15px; display: flex; justify-content: space-between; align-items: center; }
#mobelpanel h2 button { padding: 0 8px; }
#mobelpanel.ihop #mobelinnehall { display: none; }
#mobelpanel .tips { margin: 0 0 8px; color: #5a6672; font-size: 12px; }
#katalog { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
#katalog button { padding: 5px 2px; font-size: 11px; display: flex; flex-direction: column; align-items: center; gap: 1px; }
#katalog button span { font-size: 20px; }
[hidden] { display: none !important; }
#vald { margin-top: 8px; padding: 8px; background: #fff6dc; border-radius: 8px; display: flex; flex-wrap: wrap; gap: 5px; }
#valdnamn { width: 100%; font-weight: 600; }
#mobelpanel .rad { display: flex; gap: 5px; margin-top: 8px; }
#mobelpanel .rad button { flex: 1; font-size: 12px; }

#prompt { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); z-index: 8; background: rgba(20,28,38,.85); color: #fff;
  padding: 8px 16px; border-radius: 20px; font-size: 15px; pointer-events: none; }
#prompt kbd { background: #fff; color: #222; border-radius: 4px; padding: 0 6px; margin-right: 6px; font-weight: 700; }
#bubbla { position: fixed; z-index: 8; transform: translate(-50%, -100%); background: #fff; border: 2px solid #222; border-radius: 14px;
  padding: 6px 12px; font-size: 15px; pointer-events: none; white-space: nowrap; box-shadow: 0 3px 8px rgba(0,0,0,.2); }
#bubbla::after { content: ""; position: absolute; left: 50%; bottom: -10px; margin-left: -8px; border: 8px solid transparent; border-top-color: #222; border-bottom: 0; }
#skala { position: fixed; right: 20px; bottom: 20px; z-index: 8; background: rgba(255,255,255,.9); padding: 6px 10px; border-radius: 6px; font-size: 12px; text-align: center; }
#skala .stapel { height: 8px; border: 2px solid #222; border-top: 0; margin-bottom: 3px; }
#lageinfo { position: fixed; right: 12px; top: 64px; z-index: 8; background: rgba(255,255,255,.85); border-radius: 8px; padding: 6px 10px; font-size: 12px; color: #4a5560; max-width: 300px; }
#lageinfo:empty { display: none; }

#hjalp { position: fixed; inset: 0; margin: auto; width: min(760px, 94vw); height: fit-content; max-height: 90vh; overflow: auto; z-index: 20;
  background: #fff; border-radius: 14px; padding: 20px 24px; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
#hjalp h2 { margin-top: 0; }
#hjalp h3 { margin: 12px 0 4px; font-size: 15px; }
#hjalp .kol { display: grid; grid-template-columns: 1fr 1.3fr; gap: 24px; }
#hjalp table { border-collapse: collapse; }
#hjalp td { padding: 3px 8px 3px 0; vertical-align: top; }
#hjalp kbd { background: #eef1f5; border: 1px solid #c8d0d8; border-radius: 4px; padding: 0 5px; font-size: 12px; }
#stanghjalp { margin-top: 12px; }

#laddar { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 20px; background: #cfe3f2; z-index: 30; }
#tona { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity .8s; z-index: 15; }

.rumsnamn { font: 600 13px system-ui, sans-serif; color: #222; background: rgba(255,255,255,.75); padding: 1px 6px; border-radius: 4px; pointer-events: none; white-space: nowrap; }
