:root {
  --bg: #f4f1eb; --panel: #fbfaf7; --ink: #23211e; --muted: #7b756c; --line: #e4ded3;
  --accent: #b5653d; --accent-ink: #fff; --sel: #f0e4da;
  --topH: 56px; --leftW: 248px; --rightW: 330px;
  font-family: Inter, system-ui, -apple-system, sans-serif; font-size: 13px; color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); overflow: hidden; }
button { font: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 8px; padding: 6px 11px; }
button:hover { border-color: #cfc6b8; }
button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
button.ghost { background: transparent; }
button.ghost.on { background: var(--sel); color: var(--ink); border-color: #d9c6b6; }
input { font: inherit; }

#top { position: fixed; inset: 0 0 auto 0; height: var(--topH); display: flex; align-items: center; gap: 18px; padding: 0 14px; background: var(--panel); border-bottom: 1px solid var(--line); z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; min-width: calc(var(--leftW) - 14px); }
.brand .mark { width: 28px; height: 28px; border-radius: 7px; background: linear-gradient(135deg, #d9a07a, #b5653d); }
.brand .title { font-family: Fraunces, Georgia, serif; font-size: 17px; letter-spacing: 0.2px; }
.brand .sub { color: var(--muted); font-size: 11px; }
.views { display: flex; gap: 4px; background: #efebe3; padding: 3px; border-radius: 10px; }
.views button { border: none; background: transparent; padding: 6px 14px; }
.views button.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.tools { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.sun { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.sun input { width: 110px; accent-color: var(--accent); }

aside { position: fixed; top: var(--topH); bottom: 0; background: var(--panel); display: flex; flex-direction: column; z-index: 4; }
#left { left: 0; width: var(--leftW); border-right: 1px solid var(--line); }
#right { right: 0; width: var(--rightW); border-left: 1px solid var(--line); }
aside section { padding: 12px 14px; border-bottom: 1px solid var(--line); }
aside section.grow { flex: 1; overflow: auto; }
h3 { margin: 0 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 8px; }
h3 .hint { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: auto; font-size: 11px; }
h3 input { margin-left: auto; width: 120px; border: 1px solid var(--line); border-radius: 6px; padding: 3px 7px; text-transform: none; letter-spacing: 0; font-weight: 400; }

.levels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-bottom: 10px; }
.levels button { padding: 6px 0; font-size: 12px; }
.check { display: flex; gap: 7px; align-items: center; color: var(--ink); margin-top: 5px; cursor: pointer; }
.check input { accent-color: var(--accent); }

.rooms .lvl { font-size: 11px; color: var(--muted); margin: 10px 0 4px; }
.rooms .room { display: flex; justify-content: space-between; padding: 6px 8px; border-radius: 7px; cursor: pointer; }
.rooms .room:hover { background: #f1ede6; }
.rooms .room.on { background: var(--sel); }
.rooms .room .sf { color: var(--muted); font-size: 11px; }

#viewport { position: fixed; top: var(--topH); left: var(--leftW); right: var(--rightW); bottom: 0; }
#c { width: 100%; height: 100%; display: block; }
#loading { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; background: var(--bg); color: var(--muted); z-index: 3; }
.spin { width: 26px; height: 26px; border: 3px solid #e1d9cc; border-top-color: var(--accent); border-radius: 50%; animation: s 0.8s linear infinite; }
@keyframes s { to { transform: rotate(360deg); } }
.hud { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); background: rgba(35,33,30,.82); color: #fff; padding: 8px 14px; border-radius: 10px; font-size: 12px; }
.hidden { display: none !important; }
.pickinfo { position: absolute; left: 12px; top: 12px; background: rgba(251,250,247,.94); border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; font-size: 12px; box-shadow: 0 4px 16px rgba(0,0,0,.06); max-width: 320px; }

.sel.empty { color: var(--muted); line-height: 1.5; }
.sel .slotname { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.sel .cur { color: var(--muted); margin-bottom: 10px; }
.sel .cats { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.sel .cats button { padding: 3px 9px; font-size: 11px; border-radius: 20px; }
.lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; max-height: 46vh; overflow: auto; padding-right: 2px; }
.sw { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; cursor: pointer; background: #fff; }
.sw:hover { border-color: #cbbfae; }
.sw.on { outline: 2px solid var(--accent); outline-offset: 1px; }
.sw .chip { height: 48px; background-size: cover; background-position: center; }
.sw .nm { font-size: 10.5px; padding: 5px 6px 6px; line-height: 1.25; }
.sw .br { color: var(--muted); font-size: 9.5px; }

.slots .grp { margin: 2px 0; padding: 6px 4px; font-size: 12px; color: var(--ink); font-weight: 600; cursor: pointer; display: flex; gap: 6px; align-items: center; border-radius: 6px; }
.slots .grp:hover { background: #f1ede6; }
.slots .grp .car { color: var(--muted); width: 10px; }
.slots .grp .n { margin-left: auto; color: var(--muted); font-weight: 400; font-size: 11px; }
.sel .scope { display: flex; gap: 4px; align-items: center; margin-bottom: 8px; font-size: 11px; color: var(--muted); }
.sel .scope span { margin-right: 4px; }
.sel .scope button { padding: 3px 8px; font-size: 11px; border-radius: 20px; }
.sel .scope button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.slots .slot { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 7px; cursor: pointer; }
.slots .slot:hover { background: #f1ede6; }
.slots .slot.on { background: var(--sel); }
.slots .dot { width: 18px; height: 18px; border-radius: 5px; border: 1px solid rgba(0,0,0,.1); background-size: cover; flex: none; }
.slots .lbl { flex: 1; }
.slots .val { color: var(--muted); font-size: 10.5px; max-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

dialog { border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; width: 520px; background: var(--panel); color: var(--ink); }
dialog::backdrop { background: rgba(30,25,20,.25); }
dialog h3 { font-size: 13px; }
.muted { color: var(--muted); margin: 0 0 12px; }
.row { display: flex; gap: 8px; align-items: center; margin: 10px 0; }
.row input { flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; }
.spacer { flex: 1; }
.schemelist { display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow: auto; }
.schemelist .it { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
.schemelist .it span { flex: 1; }
.filebtn { border: 1px solid var(--line); border-radius: 8px; padding: 6px 11px; cursor: pointer; }
.filebtn input { display: none; }

.drawlist { max-height: 200px; overflow: auto; }
.drawlist .it { padding: 5px 8px; border-radius: 7px; cursor: pointer; font-size: 12px; display: flex; justify-content: space-between; gap: 8px; }
.drawlist .it:hover { background: #f1ede6; }
.drawlist .it .sh { color: var(--muted); font-size: 11px; }
.elevimg { position: absolute; pointer-events: none; mix-blend-mode: multiply; opacity: .55; z-index: 2; }
.comparebar { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); display: flex; gap: 14px; align-items: center; background: rgba(251,250,247,.96); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; z-index: 3; box-shadow: 0 6px 24px rgba(0,0,0,.08); }
.comparebar label { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 12px; }
.comparebar input { width: 110px; accent-color: var(--accent); }
.pickinfo .muted2 { color: var(--muted); font-size: 11px; }
.pickinfo { line-height: 1.45; }
#issuesDlg { width: 640px; }
.issues { max-height: 60vh; overflow: auto; display: flex; flex-direction: column; gap: 8px; }
.issues .is { border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: #fff; }
.issues .is b { font-size: 13px; }
.issues .is .sh { color: var(--accent); font-size: 11px; margin-left: 6px; }
.issues .is p { margin: 4px 0 0; line-height: 1.45; }
.issues .is .mdl { color: var(--muted); font-size: 12px; }
.genlink { color: var(--accent); text-decoration: none; font-weight: 500; font-size: 13px; padding: 6px 10px; border-radius: 8px; border: 1px solid #ecd9cc; background: #fbf3ee; white-space: nowrap; }
.genlink:hover { background: #f6e7dd; }
#fixturesDlg { width: 720px; }
.fx-room { font-weight: 600; margin: 8px 0 2px; display: flex; justify-content: space-between; }
.fx-row { display: grid; grid-template-columns: 110px 1fr 40px 80px; gap: 8px; font-size: 12px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.fx-row .m { color: var(--muted); font-size: 11px; }
.fx-row .p { text-align: right; }
.seg { display: flex; gap: 2px; background: #efebe3; padding: 3px; border-radius: 9px; }
.seg button { border: none; background: transparent; padding: 5px 10px; font-size: 12px; }
.seg button.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
