:root {
  --bg: #0d0f14;
  --surface: #161820;
  --surface2: #1e2029;
  --border: #2a2d3a;
  --accent: #4DA3FF;
  --accent2: #2563EB;
  --green: #3ecf8e;
  --blue: #4a9eff;
  --text: #e8eaf0;
  --text2: #8b8fa8;
  --text3: #5a5e72;
  --carport: #3b82f6;
  --garden: #15803d;
  --pool: #0891b2;
}
* { margin:0; padding:0; box-sizing:border-box; }
html { height: 100%; overflow: hidden; }
body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  width: 100vw;
  max-width: 100vw;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* HEADER */
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; height: 52px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  flex-shrink: 0; z-index: 100; gap: 10px; width: 100%; overflow: hidden;
}
.logo { flex-shrink: 1; min-width: 0; overflow: hidden; }
.header-tabs { flex-shrink: 0; }
.header-actions { flex-shrink: 0; }
.logo {
  display: flex; align-items: center; gap: 9px;
  font-family: 'Space Mono', monospace; font-weight: 700; font-size: 15px; letter-spacing: -0.5px;
}
.logo-icon {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.logo-img { width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0; }
.logo span { color: var(--accent); }
.ver-badge {
  font-family: 'Space Mono', monospace; font-size: 10px; font-weight: 700;
  background: rgba(245,166,35,0.15); color: var(--accent);
  border: 1px solid rgba(245,166,35,0.4); border-radius: 5px; padding: 2px 6px; margin-left: 2px;
}
.header-tabs { display: flex; gap: 2px; background: var(--bg); border-radius: 9px; padding: 3px; }
.tab-btn {
  padding: 6px 16px; border-radius: 7px; border: none; background: transparent; color: var(--text2);
  font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.18s;
}
.tab-btn.active { background: var(--surface2); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,0.3); }
.header-actions { display: flex; gap: 6px; align-items: center; }
.sep-v { width: 1px; height: 22px; background: var(--border); margin: 0 2px; }
.btn-sm {
  padding: 6px 12px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--surface2); color: var(--text); font-family: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all 0.18s;
}
.btn-sm:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm.icon-btn { padding: 6px 10px; font-size: 14px; }
.btn-primary {
  padding: 6px 14px; border-radius: 7px; border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff;
  font-family: inherit; font-size: 12px; font-weight: 700; cursor: pointer; transition: opacity 0.18s;
}
.btn-primary:hover { opacity: 0.88; }

/* DROPDOWN MENU */
.menu-wrap { position: relative; }
.dropdown {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 6px; min-width: 220px; box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  display: none; z-index: 500;
}
.dropdown.show { display: block; }
.dropdown-label { font-size: 9.5px; font-weight: 700; letter-spacing: 1px; color: var(--text3); text-transform: uppercase; padding: 7px 10px 4px; }
.dropdown button {
  display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px;
  border: none; background: transparent; color: var(--text); font-family: inherit; font-size: 12.5px;
  font-weight: 500; cursor: pointer; transition: all 0.12s;
}
.dropdown button:hover { background: var(--surface2); color: var(--accent); }
.dropdown button.danger:hover { color: var(--accent2); background: rgba(232,82,58,0.1); }
.dropdown-sep { height: 1px; background: var(--border); margin: 5px 4px; }

/* ── Header polish (grouped, modern) ── */
.header-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 1; min-width: 0; }
.header-actions .sep-v { width: 1px; height: 22px; background: var(--border); margin: 0 2px; flex-shrink: 0; }
.btn-sm.accent-green { border-color: rgba(62,207,142,.5); color: #3ecf8e; background: rgba(62,207,142,.08); }
.btn-sm.accent-green:hover { background: rgba(62,207,142,.16); border-color: #3ecf8e; }
.menu-trigger { display: inline-flex; align-items: center; gap: 4px; }
.dropdown { animation: ddIn .14s ease; }
@keyframes ddIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
#buildingTypeIndicator { color: var(--accent) !important; font-weight: 700; }

/* MAIN LAYOUT */
.app-body { display: flex; flex: 1; overflow: hidden; min-height: 0; min-width: 0; }

/* LEFT TOOLBAR — modern grouped rail */
.toolbar {
  width: 64px; background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface) 88%, #000));
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; padding: 12px 0 14px; gap: 2px; flex-shrink: 0;
  overflow-y: auto; overflow-x: hidden;
}
.toolbar::-webkit-scrollbar { width: 0; }
.tool-group-label {
  font-size: 8px; font-weight: 800; letter-spacing: 1.2px; color: var(--text3);
  margin: 4px 0 4px; opacity: .85;
}
.tool-btn {
  width: 44px; height: 44px; border-radius: 12px; border: 1px solid transparent; background: transparent;
  color: var(--text2); font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: transform .14s, background .14s, color .14s, border-color .14s; position: relative;
}
.tool-btn:hover { background: var(--surface2); color: var(--text); transform: translateY(-1px); }
.tool-btn:active { transform: translateY(0); }
.tool-btn.active {
  background: rgba(245,166,35,0.16); border-color: var(--accent); color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245,166,35,.08);
}
.tool-sep { width: 30px; height: 1px; background: var(--border); margin: 7px 0; }
.tool-tip {
  position: absolute; left: 50px; background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 6px;
  white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity 0.15s; z-index: 999;
}
.tool-btn:hover .tool-tip { opacity: 1; }

/* CENTER COLUMN */
.center-col { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.canvas-wrap {
  flex: 1; position: relative; overflow: hidden; background: var(--bg);
  background-image:
    radial-gradient(circle at 50% 40%, rgba(74,158,255,0.04) 0%, transparent 70%);
}
#floorCanvas { position: absolute; top: 0; left: 0; cursor: crosshair; }

/* COMPASS */
.compass {
  position: absolute; top: 14px; right: 14px; width: 66px; z-index: 12;
  display: flex; flex-direction: column; align-items: center; gap: 4px; user-select: none;
}
.compass-dial {
  width: 56px; height: 56px; border-radius: 50%;
  background: radial-gradient(circle, var(--surface), var(--bg));
  border: 1px solid var(--border); position: relative; cursor: grab;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}
.compass-dial:active { cursor: grabbing; }
.compass-needle {
  position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform: translate(-50%,-100%);
  border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 22px solid var(--accent2);
}
.compass-needle::after {
  content:''; position: absolute; left: -6px; top: 22px;
  border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 22px solid var(--text3);
}
.compass-dial span {
  position: absolute; font-family: 'Space Mono', monospace; font-size: 9px; font-weight: 700; color: var(--text2);
}
.compass-n { top: 2px; left: 50%; transform: translateX(-50%); color: var(--accent2)!important; }
.compass-s { bottom: 2px; left: 50%; transform: translateX(-50%); }
.compass-e { right: 4px; top: 50%; transform: translateY(-50%); }
.compass-w { left: 4px; top: 50%; transform: translateY(-50%); }
.compass-deg { font-family: 'Space Mono', monospace; font-size: 10px; color: var(--text2); background: var(--surface); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; }

.scale-indicator {
  position: absolute; top: 12px; left: 12px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 7px; padding: 5px 10px; font-family: 'Space Mono', monospace; font-size: 11px; color: var(--text2); z-index: 11;
}
.canvas-hint {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 7px 16px;
  font-size: 12px; color: var(--text2); font-weight: 500; pointer-events: none; white-space: nowrap; z-index: 11;
}
.canvas-hint b { color: var(--accent); }
.zoom-controls { position: absolute; bottom: 14px; right: 14px; display: flex; flex-direction: column; gap: 4px; z-index: 11; }
.zoom-btn {
  width: 32px; height: 32px; background: var(--surface); border: 1px solid var(--border); border-radius: 7px;
  color: var(--text); font-size: 17px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.18s;
}
.zoom-btn:hover { border-color: var(--accent); color: var(--accent); }

/* FLOOR BAR */
.floor-bar {
  height: 52px; flex-shrink: 0; background: var(--surface); border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; padding: 0 14px;
}
.floor-bar-label { font-size: 9px; font-weight: 700; letter-spacing: 1.5px; color: var(--text3); }
.floor-tabs { display: flex; gap: 6px; flex: 1; overflow-x: auto; padding: 2px 0; }
.floor-tabs::-webkit-scrollbar { height: 0; }
.floor-tab {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  padding: 6px 13px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg);
  cursor: pointer; transition: all 0.16s; white-space: nowrap; min-width: 92px;
}
.floor-tab:hover { border-color: var(--text3); }
.floor-tab.active { background: rgba(245,166,35,0.12); border-color: var(--accent); }
.floor-tab .ft-name { font-size: 12px; font-weight: 700; color: var(--text); }
.floor-tab.active .ft-name { color: var(--accent); }
.floor-tab .ft-area { font-size: 10px; font-family: 'Space Mono', monospace; color: var(--text3); }
.floor-bar-actions { display: flex; gap: 6px; align-items: center; }
.ghost-toggle { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text2); font-weight: 600; cursor: pointer; margin-right: 4px; }
.ghost-toggle input { accent-color: var(--accent); }
.floor-act {
  padding: 6px 11px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface2);
  color: var(--text2); font-family: inherit; font-size: 11px; font-weight: 600; cursor: pointer; transition: all 0.16s;
}
.floor-act:hover { border-color: var(--accent); color: var(--accent); }
.floor-act.danger:hover { border-color: var(--accent2); color: var(--accent2); }

/* RIGHT PANEL */
.right-panel { width: clamp(200px, 19vw, 290px); background: var(--surface); border-left: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; overflow: hidden; }
.panel-tabs { display: flex; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.ptab { flex: 1; padding: 11px 0; text-align: center; font-size: 11.5px; font-weight: 600; color: var(--text2); cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.18s; }
.ptab:hover { color: var(--text); }
.ptab.active { color: var(--accent); border-bottom-color: var(--accent); }
.panel-view { display: none; flex-direction: column; flex: 1; overflow: hidden; }
.panel-view.active { display: flex; }
/* panel Ruangan bisa digulir vertikal (desktop & HP) */
#pv-rooms { overflow-y: auto; }
.panel-section { border-bottom: 1px solid var(--border); padding: 14px 16px; }
.panel-title { font-size: 10px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text3); margin-bottom: 10px; }

/* ACTIVE FLOOR CARD */
.active-floor-card {
  background: linear-gradient(135deg, rgba(245,166,35,0.1), rgba(232,82,58,0.04));
  border: 1px solid rgba(245,166,35,0.3); border-radius: 10px; padding: 10px 12px;
  display: flex; align-items: center; justify-content: space-between;
}
.afc-name { font-size: 14px; font-weight: 800; color: var(--accent); }
.afc-meta { font-size: 11px; color: var(--text2); font-family: 'Space Mono', monospace; }

/* ROOMS LIST */
.room-item { display: flex; align-items: center; justify-content: space-between; padding: 7px 10px; border-radius: 7px; cursor: pointer; transition: all 0.15s; margin-bottom: 3px; }
.room-item:hover { background: var(--surface2); }
.room-item.selected { background: rgba(74,158,255,0.1); border: 1px solid rgba(74,158,255,0.3); }
.room-dot { width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; flex-shrink: 0; }
.room-name { font-size: 12px; font-weight: 600; flex: 1; }
.room-size { font-size: 11px; color: var(--text2); font-family: 'Space Mono', monospace; }
.room-del { font-size: 14px; color: var(--text3); cursor: pointer; padding: 2px 4px; border-radius: 3px; }
.room-del:hover { color: var(--accent2); background: rgba(232,82,58,0.1); }

.add-room-row { display: flex; gap: 6px; margin-top: 8px; }
.add-room-size { display: flex; align-items: center; gap: 6px; margin-top: 7px; font-size: 12px; color: var(--text2); }
.add-room-size label { flex-shrink: 0; }
.add-room-size .prop-input { width: 100%; min-width: 0; }
.add-room-size span { color: var(--text3); }
.add-room-hint { font-size: 10.5px; color: var(--text3); line-height: 1.5; margin-top: 7px; }
.add-room-hint b { color: var(--text2); }
.input-sm, .select-sm {
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px; color: var(--text);
  font-family: inherit; font-size: 12px; padding: 6px 9px; outline: none; transition: border-color 0.2s;
}
.input-sm { flex: 1; }
.select-sm { cursor: pointer; flex: 1; }
.select-sm.wide { width: 130px; flex: none; }
.input-sm:focus, .select-sm:focus { border-color: var(--accent); }
.btn-add { padding: 6px 12px; background: var(--blue); border: none; border-radius: 6px; color: #fff; font-size: 12px; font-weight: 700; cursor: pointer; transition: opacity 0.2s; white-space: nowrap; }
.btn-add:hover { opacity: 0.85; }

/* PROPS */
.prop-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; gap: 8px; }
.prop-label { font-size: 12px; color: var(--text2); font-weight: 500; }
.prop-value { font-size: 12px; font-weight: 700; font-family: 'Space Mono', monospace; color: var(--text); }
.prop-value.accent { color: var(--accent); }
.prop-input { width: 76px; background: var(--bg); border: 1px solid var(--border); border-radius: 5px; color: var(--text); font-family: 'Space Mono', monospace; font-size: 12px; padding: 5px 8px; text-align: right; outline: none; }
.prop-input:focus { border-color: var(--accent); }
.unit { font-size: 11px; color: var(--text3); width: 14px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--text); font-weight: 600; }
.toggle-row input { accent-color: var(--accent); width: 16px; height: 16px; }

/* AUTO DIM BOX */
.auto-dim-box .dim-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dim-cell { background: var(--surface2); border: 1px solid var(--border); border-radius: 9px; padding: 9px 10px; }
.dim-k { display: block; font-size: 10px; color: var(--text3); font-weight: 600; margin-bottom: 3px; }
.dim-v { font-size: 15px; font-weight: 800; font-family: 'Space Mono', monospace; }
.dim-v.accent { color: var(--accent); }

/* SELECTED ROOM PROPS */
.srp-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.srp-row label { font-size: 11px; color: var(--text2); width: 60px; }

/* SITE */
.site-legend { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.site-chip { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text); font-weight: 500; }
.site-chip .sw { width: 13px; height: 13px; border-radius: 3px; }
.site-hint { font-size: 11px; color: var(--text3); line-height: 1.6; background: var(--surface2); border-radius: 8px; padding: 9px 11px; margin-bottom: 10px; }
.site-zone-item { display: flex; align-items: center; justify-content: space-between; padding: 6px 9px; border-radius: 6px; background: var(--surface2); margin-bottom: 4px; font-size: 11px; }
.site-zone-item .szi-del { color: var(--text3); cursor: pointer; }
.site-zone-item .szi-del:hover { color: var(--accent2); }

/* ROOF */
.roof-sub { font-size: 11.5px; color: var(--text2); line-height: 1.6; margin-bottom: 12px; }
.roof-sub b { color: var(--accent); }
.roof-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.roof-card {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 10px;
  cursor: pointer; transition: all 0.16s; text-align: center;
}
.roof-card:hover { border-color: var(--text3); }
.roof-card.active { border-color: var(--accent); background: rgba(245,166,35,0.08); }
.roof-card svg { width: 100%; height: 44px; display: block; margin-bottom: 6px; }
.roof-card .rc-name { font-size: 12px; font-weight: 700; }
.roof-card .rc-desc { font-size: 9.5px; color: var(--text3); margin-top: 1px; }
.roof-card.active .rc-name { color: var(--accent); }
.roof-note { font-size: 11px; color: var(--text3); line-height: 1.6; margin-top: 12px; background: var(--surface2); border-radius: 8px; padding: 9px 11px; }

/* FURNITURE */
.furn-search-wrap { position: relative; }
.furn-search { width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 7px; color: var(--text); font-family: inherit; font-size: 12px; padding: 7px 10px 7px 28px; outline: none; transition: border-color 0.2s; margin-bottom: 8px; }
.furn-search:focus { border-color: var(--accent); }
.furn-search-icon { position: absolute; left: 9px; top: 38%; transform: translateY(-50%); font-size: 12px; color: var(--text3); pointer-events: none; }
.furn-cats { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
.furn-cat { padding: 3px 9px; border-radius: 20px; border: 1px solid var(--border); background: transparent; color: var(--text2); font-size: 11px; font-weight: 600; cursor: pointer; transition: all 0.15s; font-family: inherit; }
.furn-cat.active { background: rgba(245,166,35,0.15); border-color: var(--accent); color: var(--accent); }
.furn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; overflow-y: auto; flex: 1; padding-bottom: 8px; }
.furn-grid::-webkit-scrollbar { width: 3px; }
.furn-grid::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.furn-card { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 6px 6px; cursor: grab; transition: all 0.15s; text-align: center; user-select: none; }
.furn-card:hover { border-color: var(--accent); background: rgba(245,166,35,0.06); transform: translateY(-1px); }
.furn-card:active { cursor: grabbing; transform: scale(0.97); }
.furn-icon { font-size: 22px; margin-bottom: 4px; display: block; }
.furn-name { font-size: 10px; font-weight: 600; color: var(--text2); line-height: 1.3; }
.furn-size { font-size: 9px; color: var(--text3); font-family: 'Space Mono', monospace; margin-top: 2px; }
.furn-ghost { position: fixed; pointer-events: none; z-index: 9999; opacity: 0.85; font-size: 32px; transform: translate(-50%,-50%); display: none; filter: drop-shadow(0 4px 12px rgba(245,166,35,0.5)); }
.furn-infobar { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; display: none; gap: 8px; align-items: center; font-size: 12px; z-index: 13; }
.furn-infobar.show { display: flex; }
.furn-infobar-name { font-weight: 700; color: var(--text); }
.furn-infobar-btn { padding: 3px 8px; border-radius: 5px; border: 1px solid var(--border); background: var(--surface2); color: var(--text2); font-size: 11px; font-weight: 600; cursor: pointer; transition: all 0.15s; font-family: inherit; }
.furn-infobar-btn:hover { border-color: var(--accent); color: var(--accent); }
.furn-infobar-btn.del:hover { border-color: var(--accent2); color: var(--accent2); }

/* RAB FULLVIEW */
.rab-fullview {
  position: fixed; inset: 52px 0 0 0; background: var(--bg); z-index: 200; display: none; flex-direction: column;
}
.rab-fullview.show { display: flex; }
.rab-fv-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 28px; border-bottom: 1px solid var(--border); flex-shrink: 0; background: var(--surface); }
.rab-fv-title { font-size: 18px; font-weight: 800; }
.rab-fv-sub { font-size: 12px; color: var(--text2); margin-top: 2px; }
.rab-fv-actions { display: flex; gap: 8px; align-items: center; }
.city-row { display: flex; gap: 6px; align-items: center; }
.city-label { font-size: 12px; color: var(--text2); font-weight: 500; white-space: nowrap; }
.rab-fv-body { flex: 1; overflow-y: auto; padding: 24px 28px; max-width: 900px; width: 100%; margin: 0 auto; }
.rab-item { background: var(--surface); border-radius: 9px; padding: 13px 16px; margin-bottom: 8px; border: 1px solid var(--border); }
.rab-item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.rab-item-name { font-size: 13px; font-weight: 700; }
.rab-item-total { font-size: 14px; font-weight: 800; color: var(--accent); font-family: 'Space Mono', monospace; }
.rab-item-detail { font-size: 11.5px; color: var(--text2); }
.rab-total-box { background: linear-gradient(135deg, rgba(245,166,35,0.12), rgba(232,82,58,0.05)); border: 1px solid rgba(245,166,35,0.3); border-radius: 12px; padding: 18px; margin-top: 12px; }
.rab-total-label { font-size: 11px; color: var(--text2); font-weight: 600; letter-spacing: 0.5px; margin-bottom: 4px; }
.rab-total-value { font-size: 28px; font-weight: 800; color: var(--accent); font-family: 'Space Mono', monospace; }
.rab-total-sub { font-size: 11px; color: var(--text3); margin-top: 6px; }
.rab-section-title { font-size: 11px; font-weight: 700; letter-spacing: 1px; color: var(--text3); text-transform: uppercase; margin: 18px 0 8px; }

/* MODAL 3D */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.82); z-index: 1000; display: none; align-items: center; justify-content: center; }
.modal-overlay.show { display: flex; }
.modal-box { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; width: 92vw; max-width: 1100px; height: 84vh; display: flex; flex-direction: column; overflow: hidden; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.modal-title { font-size: 15px; font-weight: 700; }
.modal-close { width: 28px; height: 28px; background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-size: 15px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.modal-close:hover { border-color: var(--accent2); color: var(--accent2); }
#view3d { flex: 1; position: relative; overflow: hidden; }
#three-canvas-container { width: 100%; height: 100%; }
#three-canvas-container canvas { display: block; touch-action: none; }
#view3d-hint { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); background: rgba(13,15,20,0.82); border: 1px solid var(--border); border-radius: 8px; padding: 7px 14px; font-size: 11px; color: var(--text2); white-space: nowrap; pointer-events: none; }
#view3d-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--bg); font-size: 14px; color: var(--text2); }

/* DEV SITEPLAN 3D */
#dev3dView { flex: 1; position: relative; overflow: hidden; }
#dev3d-canvas-container { width: 100%; height: 100%; }
#dev3d-canvas-container canvas { display: block; touch-action: none; }
#dev3d-hint { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); background: rgba(13,15,20,0.82); border: 1px solid var(--border); border-radius: 8px; padding: 7px 14px; font-size: 11px; color: var(--text2); white-space: nowrap; pointer-events: none; }
#dev3d-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--bg); font-size: 14px; color: var(--text2); }

/* AI RENDER */
.airender-body { flex: 1; overflow: hidden; display: grid; grid-template-columns: 340px 1fr; gap: 0; }
.air-left { padding: 18px; overflow-y: auto; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 14px; }
.air-panel { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.air-h { font-size: 11px; font-weight: 700; letter-spacing: 0.5px; color: var(--text2); text-transform: uppercase; margin-bottom: 6px; }
.air-sub { font-size: 11px; color: var(--text3); line-height: 1.5; margin-bottom: 10px; }
.air-keyrow { display: flex; gap: 6px; }
.air-input { flex: 1; width: 100%; background: var(--surface2); border: 1px solid var(--border); border-radius: 7px; color: var(--text); font-family: inherit; font-size: 12px; padding: 8px 10px; outline: none; }
.air-input:focus { border-color: #a78bfa; }
.air-btn { padding: 8px 12px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface2); color: var(--text); font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.air-btn:hover { border-color: #a78bfa; color: #c4b5fd; }
.air-keystat { font-size: 11px; margin-top: 8px; color: var(--text2); }
.air-styles { display: flex; flex-wrap: wrap; gap: 6px; }
.air-chip { padding: 6px 11px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface2); color: var(--text2); font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.15s; }
.air-chip.active { background: rgba(167,139,250,0.15); border-color: #a78bfa; color: #c4b5fd; }
.air-textarea { width: 100%; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-family: inherit; font-size: 12px; padding: 9px 11px; outline: none; resize: vertical; min-height: 60px; }
.air-textarea:focus { border-color: #a78bfa; }
.air-render-btn { padding: 13px; border-radius: 10px; border: none; background: linear-gradient(135deg,#8b5cf6,#6366f1); color: #fff; font-family: inherit; font-size: 14px; font-weight: 800; cursor: pointer; transition: opacity 0.15s; }
.air-render-btn:hover:not(:disabled) { opacity: 0.9; }
.air-render-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.air-note { font-size: 10.5px; color: var(--text3); line-height: 1.55; }
.air-quota { display: flex; align-items: center; gap: 12px; margin: 4px 0 10px; }
.air-quota-num { font-family: 'Space Mono', monospace; font-size: 38px; font-weight: 700; line-height: 1; color: #c4b5fd; }
.air-quota-lbl { font-size: 12px; font-weight: 700; color: var(--text); line-height: 1.3; }
.air-quota-lbl span { display: block; font-size: 10.5px; font-weight: 500; color: var(--text3); margin-top: 3px; }
.air-btn-pay { width: 100%; margin-top: 12px; padding: 11px; border-radius: 9px; border: none; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; font-family: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
.air-btn-pay:hover { opacity: 0.9; }
.air-right { padding: 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; background: #14161d; }
.air-preview-box { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 12px; min-height: 200px; display: flex; flex-direction: column; }
.air-preview-label { font-size: 10px; font-weight: 700; letter-spacing: 1px; color: var(--text3); text-transform: uppercase; margin-bottom: 8px; }
.air-img { width: 100%; border-radius: 8px; display: block; }
.air-empty { flex: 1; display: flex; flex-direction: column; gap: 10px; align-items: center; justify-content: center; color: var(--text3); font-size: 12px; min-height: 160px; }
.air-error { color: #f8a; font-size: 12px; line-height: 1.6; padding: 10px; }
@media (max-width: 760px){ .airender-body { grid-template-columns: 1fr; } .air-left { border-right: none; border-bottom: 1px solid var(--border); } }

/* ===================== USER PLAN ===================== */
.plan-badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 20px; border: 1.5px solid var(--text3); background: var(--surface2); color: var(--text2); font-family: inherit; font-size: 12px; font-weight: 700; cursor: pointer; transition: all 0.15s; }
.plan-badge:hover { filter: brightness(1.2); transform: translateY(-1px); }
.plan-badge .pb-ic { font-size: 13px; }
.plan-badge .pb-name { white-space: nowrap; }
/* lock indicator on gated controls */
.feat-locked { position: relative; opacity: 0.6; }
.feat-locked::after { content: '🔒'; font-size: 9px; position: absolute; top: 1px; right: 2px; opacity: 0.95; filter: grayscale(0.2); pointer-events: none; }
.ai-nav-item.feat-locked::after { top: 8px; right: 8px; font-size: 11px; }
.dropdown button.feat-locked, .floor-act.feat-locked { opacity: 0.55; }
.dropdown button.feat-locked::after { right: 8px; top: 8px; }

/* plan modal */
.plan-modal-body { padding: 22px; overflow-y: auto; }
.plan-locked-banner { background: rgba(245,166,35,0.12); border: 1px solid rgba(245,166,35,0.4); color: #f3c969; border-radius: 10px; padding: 12px 16px; font-size: 13px; margin-bottom: 18px; line-height: 1.5; }
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.plan-card { background: var(--bg); border: 1.5px solid var(--border); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; transition: all 0.18s; }
.plan-card.highlight { border-color: var(--pc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pc) 22%, transparent); }
.plan-card.current { border-color: var(--pc); }
.plan-card-h { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.plan-ic { font-size: 26px; width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; background: var(--surface2); border-radius: 12px; }
.plan-name { font-size: 17px; font-weight: 800; color: var(--pc); }
.plan-tag { font-size: 11px; color: var(--text3); line-height: 1.4; margin-top: 2px; }
.plan-price { font-size: 26px; font-weight: 800; font-family: 'Space Mono', monospace; margin-bottom: 14px; }
.plan-price .plan-per { font-size: 12px; color: var(--text3); font-weight: 500; font-family: 'Plus Jakarta Sans', sans-serif; margin-left: 4px; }
.plan-perks { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.plan-perks li { font-size: 12px; color: var(--text2); padding-left: 22px; position: relative; line-height: 1.4; }
.plan-perks li::before { content: '✓'; position: absolute; left: 0; top: 0; color: var(--pc); font-weight: 800; }
.plan-btn { padding: 11px; border-radius: 9px; border: none; background: var(--pc); color: #14161d; font-family: inherit; font-size: 13px; font-weight: 800; cursor: pointer; transition: opacity 0.15s; }
.plan-btn:hover:not(:disabled) { opacity: 0.88; }
.plan-btn.cur { background: var(--surface2); color: var(--text2); cursor: default; }
.plan-note { font-size: 11px; color: var(--text3); line-height: 1.6; margin-top: 18px; text-align: center; }
@media (max-width: 720px){ .plan-grid { grid-template-columns: 1fr; } }

/* ===================== CHECKOUT ===================== */
.plan-substat { font-size: 11.5px; color: var(--text2); line-height: 1.5; background: var(--surface2); border-radius: 8px; padding: 9px 11px; margin-bottom: 8px; }
.plan-substat b { color: var(--text); }
.plan-substat span { color: var(--text3); font-size: 10.5px; }
.plan-btn.cancel { background: transparent; border: 1px solid var(--border); color: var(--text3); }
.plan-btn.cancel:hover { border-color: var(--accent2); color: var(--accent2); opacity: 1; }
.pb-exp { font-size: 10px; font-weight: 600; opacity: 0.8; margin-left: 6px; padding-left: 6px; border-left: 1px solid currentColor; white-space: nowrap; }

.checkout-body { padding: 20px; overflow-y: auto; }
.co-grid { display: grid; grid-template-columns: 1fr 280px; gap: 18px; }
.co-main { display: flex; flex-direction: column; gap: 16px; }
.co-sec { }
.co-h { font-size: 11px; font-weight: 700; letter-spacing: 0.5px; color: var(--text2); text-transform: uppercase; margin-bottom: 9px; }
.co-cycles { display: flex; flex-direction: column; gap: 8px; }
.co-cycle { display: flex; align-items: center; gap: 11px; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 10px; cursor: pointer; transition: all 0.15s; }
.co-cycle.active { border-color: var(--accent); background: rgba(245,166,35,0.08); }
.co-cycle input { accent-color: var(--accent); width: 16px; height: 16px; }
.co-cycle-t { font-size: 13px; font-weight: 700; }
.co-cycle > div { min-width: 0; }
.co-cycle-s { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.co-cycle-s { font-size: 11px; color: var(--text3); margin-top: 1px; }
.co-save { font-size: 9.5px; background: var(--green); color: #06281a; font-weight: 800; border-radius: 5px; padding: 1px 6px; white-space: nowrap; }
.co-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.co-method { display: flex; align-items: center; gap: 9px; padding: 10px 11px; border: 1.5px solid var(--border); border-radius: 10px; cursor: pointer; transition: all 0.15s; }
.co-method.active { border-color: var(--accent); background: rgba(245,166,35,0.08); }
.co-method input { display: none; }
.co-m-ic { font-size: 18px; }
.co-m-n { display: block; font-size: 12.5px; font-weight: 700; }
.co-m-d { display: block; font-size: 10px; color: var(--text3); margin-top: 1px; }
.co-fields { display: flex; flex-direction: column; gap: 8px; }
.co-input { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-family: inherit; font-size: 13px; padding: 10px 12px; outline: none; }
.co-input:focus { border-color: var(--accent); }
.co-summary { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 16px; align-self: start; position: sticky; top: 0; }
.co-sum-title { font-size: 12px; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; color: var(--text3); margin-bottom: 12px; }
.co-sum-row { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.co-sum-row span:last-child { font-family: 'Space Mono', monospace; font-weight: 600; }
.co-sum-sub { font-size: 10.5px; color: var(--text3); margin-bottom: 10px; }
.co-sum-div { height: 1px; background: var(--border); margin: 10px 0; }
.co-sum-row.total { font-size: 16px; font-weight: 800; }
.co-sum-row.total span:last-child { color: var(--accent); font-size: 17px; }
.co-sum-permo { font-size: 11px; color: var(--text3); text-align: right; margin-top: 2px; }
.co-pay-btn { width: 100%; margin-top: 14px; padding: 13px; border-radius: 10px; border: none; background: linear-gradient(135deg,#f5a623,#e8523a); color: #fff; font-family: inherit; font-size: 14px; font-weight: 800; cursor: pointer; transition: opacity 0.15s; }
.co-pay-btn:hover:not(:disabled) { opacity: 0.9; }
.co-pay-btn:disabled { opacity: 0.5; cursor: wait; }
.co-secure { font-size: 10.5px; color: var(--text3); text-align: center; margin-top: 9px; }
/* processing */
.co-processing { text-align: center; padding: 60px 20px; }
.co-spinner { width: 46px; height: 46px; border: 4px solid var(--border); border-top-color: var(--accent); border-radius: 50%; margin: 0 auto 20px; animation: cospin 0.8s linear infinite; }
@keyframes cospin { to { transform: rotate(360deg); } }
.co-proc-t { font-size: 16px; font-weight: 700; }
.co-proc-s { font-size: 12px; color: var(--text3); margin-top: 6px; font-family: 'Space Mono', monospace; }
/* success */
.co-success { text-align: center; padding: 16px 10px; max-width: 460px; margin: 0 auto; }
.co-check { width: 64px; height: 64px; border-radius: 50%; background: var(--green); color: #06281a; font-size: 36px; font-weight: 800; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; animation: copop 0.4s cubic-bezier(.2,1.4,.5,1); }
@keyframes copop { 0%{transform:scale(0)} 100%{transform:scale(1)} }
.co-suc-t { font-size: 18px; font-weight: 800; }
.co-suc-s { font-size: 12.5px; color: var(--text2); margin-top: 6px; line-height: 1.5; }
.co-invoice { background: var(--bg); border: 1px dashed var(--border); border-radius: 12px; padding: 16px; margin: 18px 0; text-align: left; }
.co-inv-h { display: flex; justify-content: space-between; gap: 12px; font-size: 10px; font-weight: 800; letter-spacing: 1px; color: var(--text3); margin-bottom: 10px; }
.co-inv-h span:last-child { white-space: nowrap; }
.co-inv-row { display: flex; justify-content: space-between; gap: 18px; font-size: 12.5px; margin-bottom: 6px; color: var(--text2); }
.co-inv-row span:first-child { white-space: nowrap; }
.co-inv-row span:last-child { color: var(--text); font-weight: 600; text-align: right; }
.co-inv-div { height: 1px; background: var(--border); margin: 9px 0; }
.co-inv-row.total { font-size: 15px; font-weight: 800; }
.co-inv-row.total span:last-child { color: var(--accent); font-family: 'Space Mono', monospace; }
.co-suc-btns { display: flex; flex-direction: column; gap: 8px; }
.co-ghost-btn { padding: 10px; border-radius: 9px; border: 1px solid var(--border); background: transparent; color: var(--text2); font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.co-ghost-btn:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 680px){ .co-grid { grid-template-columns: 1fr; } .co-methods { grid-template-columns: 1fr; } .co-summary { position: static; } }
#walkOverlay { position: absolute; inset: 0; pointer-events: none; display: none; }
#walkOverlay.show { display: block; }
.walk-crosshair { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); color: rgba(255,255,255,0.85); font-size: 22px; font-weight: 300; text-shadow: 0 0 4px rgba(0,0,0,0.6); }
.walk-hint { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); background: rgba(13,15,20,0.85); border: 1px solid var(--border); border-radius: 9px; padding: 9px 16px; font-size: 12px; color: var(--text); white-space: nowrap; }
.walk-hint b { color: var(--accent); }
.walk-hint-touch { display: none; }
/* Joystick gerak untuk layar sentuh */
#walkJoystick { display: none; position: absolute; left: 22px; bottom: 22px; width: 124px; height: 124px; border-radius: 50%; background: rgba(20,22,30,0.38); border: 2px solid rgba(255,255,255,0.28); pointer-events: auto; touch-action: none; z-index: 6; }
#walkJoyKnob { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; background: rgba(245,166,35,0.88); box-shadow: 0 3px 12px rgba(0,0,0,0.45); transition: transform 0.05s linear; }
@media (pointer: coarse) {
  #walkOverlay.show #walkJoystick { display: block; }
  .walk-hint-touch { display: inline; }
}
/* hide joystick during AUTO tour playback; show only when paused (free roam) */
body.tour-on:not(.tour-paused) #walkJoystick { display: none !important; }

/* TUR VIRTUAL bar */
#tourBar { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 9px; background: rgba(13,15,20,0.94); border: 1px solid #2a2d3e; border-radius: 18px; padding: 13px 16px 12px; box-shadow: 0 10px 34px rgba(0,0,0,0.55); min-width: 280px; max-width: 92vw; }
#tourBar .tb-head { display: flex; align-items: center; gap: 9px; }
#tourBar .tb-dot { width: 9px; height: 9px; border-radius: 50%; background: #f5a623; box-shadow: 0 0 0 0 rgba(245,166,35,0.55); animation: tbpulse 1.7s ease-out infinite; }
body.tour-paused #tourBar .tb-dot { background: #6b7180; animation: none; box-shadow: none; }
@keyframes tbpulse { 0% { box-shadow: 0 0 0 0 rgba(245,166,35,0.5); } 70%,100% { box-shadow: 0 0 0 8px rgba(245,166,35,0); } }
#tourBar .tb-room { font-size: 15px; font-weight: 800; color: #f4f6fb; letter-spacing: .2px; }
#tourBar .tb-prog { font-size: 11px; font-weight: 700; color: #9aa0b8; font-family: 'Space Mono', monospace; margin-left: 2px; }
#tourBar .tb-hint { font-size: 11px; color: #8a90a6; text-align: center; max-width: 320px; line-height: 1.35; }
#tourBar .tb-ctrls { display: flex; align-items: center; gap: 8px; }
#tourBar .tb-ctrls button { background: #252836; color: #e2e8f0; border: 1px solid #3a3d4e; border-radius: 13px; min-width: 42px; height: 36px; font-size: 15px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .12s, border-color .12s; }
#tourBar .tb-ctrls button:hover { background: #30374a; border-color: #4a4f63; }
#tourBar .tb-ctrls .tb-play { background: #f5a623; color: #121620; border-color: #f5a623; font-weight: 800; min-width: 52px; }
#tourBar .tb-ctrls .tb-play:hover { background: #ffb733; }
#tourBar .tb-ctrls .tb-exit { color: #ff9c8c; }
#tourBar .tb-ctrls .tb-exit:hover { background: #3a2624; border-color: #6b3a34; }
@media (max-width: 680px){ #tourBar { bottom: 14px; min-width: 240px; padding: 11px 13px 10px; } #tourBar .tb-hint { font-size: 10px; } }

/* NOTIF */
.notif { position: fixed; top: 64px; right: 16px; background: var(--surface2); border: 1px solid var(--green); border-radius: 8px; padding: 10px 16px; font-size: 13px; font-weight: 600; color: var(--green); z-index: 2000; transform: translateY(-10px); opacity: 0; transition: all 0.3s; pointer-events: none; }
.notif.show { transform: translateY(0); opacity: 1; }

/* EMPTY STATE */
.empty-state { text-align: center; padding: 24px 16px; color: var(--text3); font-size: 12px; line-height: 1.7; }
.empty-state.mini { padding: 12px 8px; }
.empty-icon { font-size: 28px; margin-bottom: 8px; }

/* MEP PANEL */
.mep-cat-toggle { display: flex; gap: 6px; margin-bottom: 10px; }
.mep-cat { flex: 1; padding: 7px 0; border-radius: 7px; border: 1px solid var(--border); background: var(--bg); color: var(--text2); font-family: inherit; font-size: 12px; font-weight: 700; cursor: pointer; transition: all 0.16s; }
.mep-cat.active { background: rgba(245,166,35,0.12); border-color: var(--accent); color: var(--accent); }
.mep-hint { font-size: 11px; color: var(--text3); line-height: 1.55; background: var(--surface2); border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; }
.mep-palette { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.mep-sym { display: flex; align-items: center; gap: 8px; padding: 8px 9px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface2); cursor: pointer; transition: all 0.15s; }
.mep-sym:hover { border-color: var(--accent); }
.mep-sym.armed { border-color: var(--accent); background: rgba(245,166,35,0.12); box-shadow: 0 0 0 1px var(--accent) inset; }
.mep-sym .ms-ic { font-size: 16px; }
.mep-sym .ms-name { font-size: 11px; font-weight: 600; line-height: 1.2; }
.mep-estimate { display: flex; flex-direction: column; gap: 6px; }
.mep-est-row { display: flex; align-items: center; justify-content: space-between; background: var(--surface2); border: 1px solid var(--border); border-radius: 7px; padding: 8px 11px; }
.mep-est-row .mer-k { font-size: 11.5px; color: var(--text2); font-weight: 500; }
.mep-est-row .mer-v { font-size: 12px; font-weight: 800; font-family: 'Space Mono', monospace; color: var(--text); }
.mep-est-row.total { background: rgba(245,166,35,0.1); border-color: rgba(245,166,35,0.3); }
.mep-est-row.total .mer-v { color: var(--accent); }
.mep-list-item { display: flex; align-items: center; justify-content: space-between; padding: 6px 9px; border-radius: 6px; background: var(--surface2); margin-bottom: 4px; font-size: 11px; }
.mep-list-item .mli-del { color: var(--text3); cursor: pointer; }
.mep-list-item .mli-del:hover { color: var(--accent2); }

/* RAB SUB-TABS */
.rab-subtabs { display: flex; gap: 4px; padding: 10px 28px 0; background: var(--surface); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.rab-subtab { padding: 9px 16px; font-size: 12.5px; font-weight: 600; color: var(--text2); cursor: pointer; border-radius: 8px 8px 0 0; border: 1px solid transparent; border-bottom: none; transition: all 0.16s; }
.rab-subtab:hover { color: var(--text); }
.rab-subtab.active { color: var(--accent); background: var(--bg); border-color: var(--border); }

/* CONSTRUCTION TABLES */
.con-table { width: 100%; border-collapse: collapse; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.con-table th { text-align: left; font-size: 10px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--text3); padding: 10px 14px; background: var(--surface2); border-bottom: 1px solid var(--border); }
.con-table th.num, .con-table td.num { text-align: right; font-family: 'Space Mono', monospace; }
.con-table td { font-size: 12.5px; padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text); }
.con-table tr:last-child td { border-bottom: none; }
.con-table td.el-name { font-weight: 700; }
.con-table td.el-sub { color: var(--text2); font-size: 11px; }
.con-table .el-total { font-weight: 800; color: var(--accent); font-family: 'Space Mono', monospace; }

/* STRUCTURE PLAN */
.struct-plan-wrap { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); margin-bottom: 14px; }
.struct-plan-wrap canvas { display: block; width: 100%; height: auto; }
.struct-cap { position: absolute; bottom: 10px; right: 12px; background: rgba(13,15,20,0.7); color: var(--text2); font-size: 11px; font-family: 'Space Mono', monospace; padding: 4px 9px; border-radius: 6px; }

/* PRICE EDITOR */
.price-group { margin-bottom: 16px; }
.price-gtitle { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text3); margin-bottom: 8px; }
.price-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.price-label { font-size: 13px; color: var(--text); }
.price-inwrap { display: flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--border); border-radius: 7px; padding: 0 10px; }
.price-inwrap span { font-size: 12px; color: var(--text3); font-family: 'Space Mono', monospace; }
.price-input { width: 120px; background: transparent; border: none; color: var(--text); font-family: 'Space Mono', monospace; font-size: 13px; padding: 8px 0; text-align: right; outline: none; }

/* DEVELOPER + TEMPLATE */
.dev-plan-wrap { border-radius: 12px; overflow: hidden; border: 1px solid var(--border); margin-top: 12px; }
.dev-plan-wrap canvas { display: block; width: 100%; height: auto; }
.tpl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tpl-card { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.tpl-thumb { display: block; width: 100%; height: auto; background: #1b1d26; border-bottom: 1px solid var(--border); }
.tpl-body { padding: 13px 14px; }
.tpl-name { font-size: 14px; font-weight: 800; }
.tpl-tag { font-size: 11px; color: #c4b5fd; font-weight: 600; margin-top: 1px; }
.tpl-specs { font-size: 11.5px; color: var(--text2); font-family: 'Space Mono', monospace; margin-top: 6px; }
.takeoff-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.mat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; text-align: center; }
.mat-card .mc-ic { font-size: 26px; }
.mat-card .mc-q { font-size: 22px; font-weight: 800; font-family: 'Space Mono', monospace; color: var(--accent); margin: 6px 0 2px; }
.mat-card .mc-u { font-size: 11px; color: var(--text2); font-weight: 600; }
.mat-card .mc-n { font-size: 11px; color: var(--text3); margin-top: 3px; }
@media (max-width: 760px){ .takeoff-grid { grid-template-columns: repeat(2,1fr); } }

/* WALL PANEL */
.wall-stat-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.wall-stat { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 6px; text-align: center; }
.wall-stat .ws-k { display: block; font-size: 9px; color: var(--text3); font-weight: 600; margin-bottom: 2px; }
.wall-stat .ws-v { font-size: 14px; font-weight: 800; font-family: 'Space Mono', monospace; }
.wall-stat .ws-v.accent { color: var(--accent); }
.wall-hint { font-size: 11px; color: var(--text3); line-height: 1.55; background: var(--surface2); border-radius: 8px; padding: 8px 10px; margin-top: 8px; }

/* LAND SHAPE */
.land-shape-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.land-shape-btn { padding: 8px 6px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface2); color: var(--text2); font-family: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; transition: all 0.15s; }
.land-shape-btn:hover { border-color: var(--accent); color: var(--accent); }

/* AUTO ALIGNMENT */
.align-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; margin-bottom: 6px; }
.align-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.align-btn { background: var(--surface2); border: 1px solid var(--border); border-radius: 7px; color: var(--text); font-size: 15px; font-family: inherit; padding: 8px 0; cursor: pointer; transition: all 0.15s; }
.align-btn.wide { font-size: 11px; font-weight: 600; }
.align-btn:hover { border-color: var(--accent); color: var(--accent); background: rgba(245,166,35,0.08); }

/* DRAWINGS */
.draw-body { flex: 1; overflow-y: auto; padding: 20px; background: #2a2d3a; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.draw-sheet { background: #f4f1ea; box-shadow: 0 8px 28px rgba(0,0,0,0.5); }
.draw-sheet canvas { display: block; }

/* AI STUDIO */
.btn-ai { padding: 6px 14px; border-radius: 7px; border: 1px solid rgba(167,139,250,0.5); background: linear-gradient(135deg, rgba(167,139,250,0.18), rgba(74,158,255,0.12)); color: #c4b5fd; font-family: inherit; font-size: 12px; font-weight: 700; cursor: pointer; transition: all 0.18s; }
.btn-ai:hover { border-color: #a78bfa; color: #ddd6fe; box-shadow: 0 0 0 1px rgba(167,139,250,0.4); }
.ai-shell { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; width: 94vw; max-width: 1160px; height: 88vh; display: flex; flex-direction: column; overflow: hidden; }
.ai-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--border); background: linear-gradient(90deg, rgba(167,139,250,0.1), transparent); flex-shrink: 0; }
.ai-head-title { font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.ai-body { flex: 1; display: flex; overflow: hidden; }
.ai-nav { width: 248px; border-right: 1px solid var(--border); padding: 12px; flex-shrink: 0; display: flex; flex-direction: column; gap: 5px; overflow-y: auto; }
.ai-nav-item { display: flex; gap: 11px; align-items: center; padding: 11px 12px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; transition: all 0.15s; }
.ai-nav-item:hover { background: var(--surface2); }
.ai-nav-item.active { background: rgba(167,139,250,0.12); border-color: rgba(167,139,250,0.4); }
.ai-nav-item .ain-ic { font-size: 20px; flex-shrink: 0; }
.ai-nav-item .ain-t { font-size: 12.5px; font-weight: 700; line-height: 1.25; }
.ai-nav-item.active .ain-t { color: #c4b5fd; }
.ai-nav-item .ain-s { font-size: 10.5px; color: var(--text3); margin-top: 2px; line-height: 1.3; }
.ai-foot { margin-top: auto; font-size: 10px; color: var(--text3); line-height: 1.5; padding: 10px; background: var(--surface2); border-radius: 8px; }
.ai-content { flex: 1; overflow-y: auto; padding: 24px 28px; }
.ai-title { font-size: 19px; font-weight: 800; margin-bottom: 4px; }
.ai-sub { font-size: 12.5px; color: var(--text2); margin-bottom: 20px; line-height: 1.6; }
.ai-card { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 18px; margin-bottom: 16px; }
.ai-card-title { font-size: 11px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: var(--text3); margin-bottom: 12px; }
.ai-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ai-field { display: flex; flex-direction: column; gap: 6px; }
.ai-field label { font-size: 12px; color: var(--text2); font-weight: 600; }
.ai-input { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-family: inherit; font-size: 13px; padding: 9px 11px; outline: none; }
.ai-input:focus { border-color: #a78bfa; }
.ai-stepper { display: flex; align-items: center; gap: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; width: fit-content; }
.ai-stepper button { width: 34px; height: 34px; border: none; background: var(--surface2); color: var(--text); font-size: 16px; cursor: pointer; transition: background 0.15s; }
.ai-stepper button:hover { background: rgba(167,139,250,0.2); }
.ai-stepper span { min-width: 44px; text-align: center; font-family: 'Space Mono', monospace; font-size: 15px; font-weight: 700; }
.ai-toggle-row { display: flex; gap: 8px; flex-wrap: wrap; }
.ai-chip { padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface2); color: var(--text2); font-size: 12.5px; font-weight: 600; cursor: pointer; transition: all 0.15s; }
.ai-chip.active { background: rgba(167,139,250,0.15); border-color: #a78bfa; color: #c4b5fd; }
.ai-btn-primary { padding: 12px 22px; border-radius: 10px; border: none; background: linear-gradient(135deg, #a78bfa, #4a9eff); color: #fff; font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer; transition: opacity 0.18s; display: inline-flex; align-items: center; gap: 8px; }
.ai-btn-primary:hover { opacity: 0.9; }
.ai-btn-primary:disabled { opacity: 0.5; cursor: wait; }
.ai-btn-ghost { padding: 10px 16px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface2); color: var(--text); font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.15s; }
.ai-btn-ghost:hover { border-color: #a78bfa; color: #c4b5fd; }
.ai-prompt { width: 100%; min-height: 90px; resize: vertical; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-family: inherit; font-size: 13.5px; padding: 13px; outline: none; line-height: 1.5; }
.ai-prompt:focus { border-color: #a78bfa; }
.ai-examples { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.ai-ex { font-size: 11.5px; color: var(--text2); background: var(--surface2); border: 1px solid var(--border); border-radius: 16px; padding: 5px 11px; cursor: pointer; transition: all 0.15s; }
.ai-ex:hover { border-color: #a78bfa; color: #c4b5fd; }
.ai-result { background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; padding: 18px; margin-top: 16px; line-height: 1.7; font-size: 13.5px; color: var(--text); white-space: pre-wrap; }
.ai-result h4 { font-size: 13px; color: #c4b5fd; margin: 14px 0 6px; font-weight: 700; }
.ai-result h4:first-child { margin-top: 0; }
.ai-loading { display: flex; align-items: center; gap: 10px; color: var(--text2); font-size: 13px; padding: 16px 0; }
.ai-spinner { width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: #a78bfa; border-radius: 50%; animation: aispin 0.7s linear infinite; }
@keyframes aispin { to { transform: rotate(360deg); } }
.opt-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 15px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; }
.opt-item.applied { border-color: var(--green); }
.opt-left { flex: 1; }
.opt-name { font-size: 13px; font-weight: 700; }
.opt-desc { font-size: 11.5px; color: var(--text2); margin-top: 2px; }
.opt-save { font-size: 14px; font-weight: 800; color: var(--green); font-family: 'Space Mono', monospace; white-space: nowrap; }
.opt-total { background: linear-gradient(135deg, rgba(62,207,142,0.15), rgba(62,207,142,0.04)); border: 1px solid rgba(62,207,142,0.4); border-radius: 12px; padding: 18px; margin: 8px 0 16px; }
.opt-total-label { font-size: 11px; color: var(--text2); font-weight: 600; }
.opt-total-value { font-size: 30px; font-weight: 800; color: var(--green); font-family: 'Space Mono', monospace; margin-top: 4px; }
.score-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 16px; }
.score-card { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 16px; text-align: center; }
.score-ring { font-size: 26px; font-weight: 800; font-family: 'Space Mono', monospace; }
.score-name { font-size: 11px; color: var(--text2); font-weight: 600; margin-top: 4px; }
.score-bar { height: 5px; border-radius: 3px; background: var(--surface2); margin-top: 8px; overflow: hidden; }
.score-fill { height: 100%; border-radius: 3px; }
.style-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; margin-bottom: 16px; }
.style-card { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 14px; cursor: pointer; transition: all 0.16s; }
.style-card:hover { border-color: var(--text3); }
.style-card.active { border-color: #a78bfa; background: rgba(167,139,250,0.06); }
.style-sw { display: flex; gap: 4px; margin-bottom: 9px; }
.style-sw span { flex: 1; height: 26px; border-radius: 5px; }
.style-card .sc-name { font-size: 13px; font-weight: 700; }
.style-card .sc-desc { font-size: 10.5px; color: var(--text3); margin-top: 2px; line-height: 1.4; }

/* INTERIOR GENERATOR */
.ig-render-wrap { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
.ig-render-wrap canvas { display: block; width: 100%; height: auto; }
.ig-render-cap { position: absolute; bottom: 10px; left: 12px; background: rgba(13,15,20,0.7); color: #fff; font-size: 12px; font-weight: 700; padding: 5px 11px; border-radius: 7px; }
.ig-fitem { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.ig-fitem b { font-family: 'Space Mono', monospace; }
.ig-ftotal { display: flex; align-items: center; justify-content: space-between; padding: 11px 0 2px; font-size: 14px; font-weight: 800; }
.ig-ftotal b { font-family: 'Space Mono', monospace; color: var(--accent); }

/* REGULATION CHECKER */
.reg-check { display: flex; gap: 12px; padding: 13px 15px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); margin-bottom: 8px; }
.reg-check.ok { border-color: rgba(62,207,142,0.35); }
.reg-check.bad { border-color: rgba(232,82,58,0.45); }
.reg-icon { font-size: 18px; }
.reg-body { flex: 1; }
.reg-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.reg-name { font-size: 13px; font-weight: 700; }
.reg-vals { font-size: 13px; font-family: 'Space Mono', monospace; white-space: nowrap; }
.reg-hint { font-size: 11px; color: var(--text3); margin-top: 4px; line-height: 1.5; }

/* ============ RESPONSIVE — fit any laptop / OS scaling ============ */
@media (max-width: 1280px) {
  header { padding: 0 12px; gap: 8px; }
  .header-tabs .tab-btn { padding: 6px 12px; }
  .header-actions { gap: 4px; }
  .btn-sm { padding: 6px 9px; }
  .right-panel { width: 264px; }
  .toolbar { width: 54px; }
  .tool-btn { width: 40px; height: 40px; font-size: 17px; }
}
@media (max-width: 1080px) {
  .logo { font-size: 13px; gap: 6px; }
  .ver-badge { display: none; }
  .header-tabs .tab-btn { padding: 6px 9px; font-size: 11px; }
  .btn-sm { font-size: 11px; padding: 6px 8px; }
  .btn-primary { padding: 6px 10px; font-size: 11px; }
  .right-panel { width: 240px; }
  .ptab { font-size: 10.5px; padding: 10px 0; }
  .floor-bar { gap: 7px; padding: 0 10px; }
  .floor-act { padding: 6px 8px; }
}
@media (max-width: 920px) {
  /* hide the button label text, keep icons, on very tight widths */
  .header-actions .btn-sm.icon-btn { padding: 6px 8px; }
  .right-panel { width: 216px; }
}

/* =====================================================================
   MOBILE / TABLET MODE  (≤860px — phones & portrait tablets)
   Toolbar + right panel become slide-in overlay drawers so the canvas
   stays full-bleed; header collapses to a "⋯" sheet. Touch handled in
   js/mobile.js. Above 860px the desktop 3-column layout is untouched.
   ===================================================================== */
.m-only { display: none; }
.m-fab, .m-backdrop, .m-sheet, .m-menu-btn { display: none; }
.m-undo-wrap { display: none; }

@media (max-width: 860px) {
  .m-only { display: flex; }
  /* floating Undo/Redo — di bawah tombol zoom +/− (kanan-atas) */
  .m-undo-wrap { display: flex; flex-direction: column; gap: 8px; position: fixed; right: 8px; top: 56px; left: auto; bottom: auto; z-index: 1250; }
  .m-undo-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 19px; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; }
  .m-undo-btn:active { background: var(--surface2); border-color: var(--accent); color: var(--accent); }

  /* --- HEADER --- */
  header { height: 50px; padding: 0 10px; gap: 8px; }
  .logo { font-size: 0; gap: 0; }            /* keep just the icon */
  .logo .logo-icon, .logo .logo-img { font-size: 15px; }
  .logo .ver-badge { display: none; }
  .header-tabs { flex: 1; justify-content: center; gap: 3px; }
  .header-tabs .tab-btn { padding: 7px 14px; font-size: 12px; }
  .header-actions { display: none; }          /* replaced by ⋯ sheet */
  .m-menu-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; flex-shrink: 0; border-radius: 9px;
    border: 1px solid var(--border); background: var(--surface2);
    color: var(--text); font-size: 20px; cursor: pointer;
  }
  .m-menu-btn:active { background: var(--surface); }

  /* --- LEFT TOOLBAR → left drawer --- */
  .toolbar {
    position: fixed !important; top: 50px; left: 0; bottom: 0; width: 78px;
    transform: translateX(-110%); transition: transform .26s cubic-bezier(.3,.8,.3,1);
    z-index: 1250; overflow-y: auto; padding: 14px 0 80px; gap: 4px;
    box-shadow: 12px 0 40px rgba(0,0,0,0); border-right: 1px solid var(--border);
  }
  .toolbar.m-open { transform: translateX(0); box-shadow: 14px 0 50px rgba(0,0,0,.55); }
  .toolbar .tool-btn { width: 50px; height: 50px; font-size: 21px; }
  .toolbar .tool-tip { display: none; }       /* no hover tips on touch */
  .tool-group-label { font-size: 9px; }

  /* --- RIGHT PANEL → right drawer --- */
  .right-panel {
    position: fixed !important; top: 50px; right: 0; bottom: 0;
    width: min(88vw, 360px) !important; flex-shrink: 0;
    transform: translateX(110%); transition: transform .26s cubic-bezier(.3,.8,.3,1);
    z-index: 1250; box-shadow: -14px 0 50px rgba(0,0,0,0);
  }
  .right-panel.m-open { transform: translateX(0); box-shadow: -14px 0 50px rgba(0,0,0,.55); }
  /* tab panel: jangan diperas — biar utuh & bisa digeser horizontal */
  .panel-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .panel-tabs::-webkit-scrollbar { display: none; }
  .ptab { flex: 0 0 auto; padding: 13px 16px; font-size: 12.5px; white-space: nowrap; }
  /* panel bisa digulir vertikal di HP + ruang bawah agar tak tertutup */
  .panel-view.active { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  #pv-rooms { padding-bottom: 90px; }

  /* --- CENTER COLUMN takes the whole body (drawers are overlays) --- */
  .app-body { display: block; position: relative; }
  .center-col { height: 100%; }

  /* bigger touch targets on panel controls */
  .prop-input { width: 84px; padding: 8px 9px; font-size: 13px; }
  .select-sm, .input-sm { padding: 9px 10px; font-size: 13px; }
  .btn-add { padding: 9px 14px; }
  .toggle-row input { width: 20px; height: 20px; }
  .align-btn { padding: 11px 0; }
  .land-shape-btn { padding: 11px 6px; }

  /* --- CANVAS overlays repositioned to avoid FABs --- */
  .compass { display: none; }
  .canvas-hint { display: none; }
  .scale-indicator { top: 8px; left: 8px; font-size: 10px; padding: 4px 8px; }
  .zoom-controls { top: 8px; right: 8px; bottom: auto; flex-direction: row; }
  .zoom-btn { width: 40px; height: 40px; font-size: 19px; }
  .furn-infobar { top: 56px; }

  /* --- FLOATING ACTION BUTTONS --- */
  .m-fab {
    position: fixed; bottom: 64px; z-index: 1100; display: inline-flex;
    align-items: center; gap: 7px; height: 48px; padding: 0 16px; border-radius: 26px;
    border: none; color: #fff; font-family: inherit; font-size: 13.5px; font-weight: 800;
    cursor: pointer; box-shadow: 0 8px 26px rgba(0,0,0,.5);
  }
  .m-fab .mf-ic { font-size: 18px; }
  .m-fab-tools { left: 14px; background: linear-gradient(135deg, var(--accent), var(--accent2)); }
  .m-fab-panel { right: 14px; background: var(--surface2); border: 1px solid var(--border); color: var(--text); }
  .m-fab:active { transform: scale(.95); }

  /* --- BACKDROP for drawers + sheet --- */
  .m-backdrop {
    position: fixed; inset: 50px 0 0 0; background: rgba(8,9,13,.55);
    backdrop-filter: blur(2px); z-index: 1200; opacity: 0; pointer-events: none;
    transition: opacity .24s; display: block;
  }
  .m-backdrop.m-open { opacity: 1; pointer-events: auto; }

  /* --- "⋯" ACTIONS SHEET (bottom) --- */
  .m-sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1300; display: block;
    background: var(--surface); border-top: 1px solid var(--border);
    border-radius: 18px 18px 0 0; padding: 8px 14px calc(16px + env(safe-area-inset-bottom));
    transform: translateY(110%); transition: transform .28s cubic-bezier(.3,.85,.3,1);
    max-height: 80vh; overflow-y: auto; box-shadow: 0 -16px 50px rgba(0,0,0,.5);
  }
  .m-sheet.m-open { transform: translateY(0); }
  .m-sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--border); margin: 6px auto 12px; }
  .m-sheet-grp-label { font-size: 9.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text3); padding: 10px 6px 6px; }
  .m-sheet-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .m-sheet-btn {
    display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 12px 4px;
    border-radius: 12px; border: 1px solid var(--border); background: var(--surface2);
    color: var(--text); font-family: inherit; font-size: 10.5px; font-weight: 600;
    cursor: pointer; text-align: center; line-height: 1.2; text-decoration: none;
  }
  .m-sheet-btn:active { background: var(--surface); border-color: var(--accent); }
  .m-sheet-btn .msb-ic { font-size: 21px; }
  .m-sheet-btn.accent { background: linear-gradient(135deg, rgba(167,139,250,.16), rgba(74,158,255,.1)); border-color: rgba(167,139,250,.4); color: #c4b5fd; }

  /* --- MODAL HEADERS: let crowded button rows wrap --- */
  .modal-box, .ai-shell { width: 96vw; height: 90vh; max-height: 90vh; }
  .modal-header { flex-wrap: wrap; gap: 8px; }
  .modal-header > div { flex-wrap: wrap; }
  .modal-header .btn-sm { padding: 7px 9px; font-size: 11px; }

  /* 3D hint smaller */
  #view3d-hint, #dev3d-hint, .walk-hint { font-size: 10px; padding: 6px 10px; white-space: normal; max-width: 90vw; text-align: center; }

  /* --- AI STUDIO: nav becomes horizontal scroller --- */
  .ai-body { flex-direction: column; }
  .ai-nav { width: 100%; flex-direction: row; overflow-x: auto; gap: 8px; padding: 10px; border-right: none; border-bottom: 1px solid var(--border); flex-shrink: 0; }
  .ai-nav-item { flex-direction: column; min-width: 120px; text-align: center; gap: 5px; padding: 10px 8px; }
  .ai-nav-item .ain-s { display: none; }
  .ai-foot { display: none; }
  .ai-content { padding: 16px; }
  .ai-grid2 { grid-template-columns: 1fr; }

  /* --- RAB fullview head wraps --- */
  .rab-fv-head { flex-wrap: wrap; gap: 10px; padding: 12px 14px; }
  .rab-fv-actions { flex-wrap: wrap; }
  .rab-fv-body, .rab-subtabs { padding-left: 14px; padding-right: 14px; }
  .rab-subtabs { overflow-x: auto; }
  .rab-total-value { font-size: 24px; }

  /* --- FLOOR BAR compact --- */
  .floor-bar { height: 52px; gap: 7px; padding: 0 10px; }
  .floor-bar-label { display: none; }
  .floor-bar-actions .floor-act { padding: 8px 9px; font-size: 11px; }
  .ghost-toggle span { display: none; }
}

/* very small phones */
@media (max-width: 420px) {
  .header-tabs .tab-btn { padding: 7px 10px; font-size: 11px; }
  .m-sheet-grid { grid-template-columns: repeat(3, 1fr); }
  .right-panel { width: 92vw !important; }
}

/* ===================== MODE INTERIOR ===================== */
#interiorPanel { display: none; position: absolute; top: 0; left: 0; bottom: 0; width: 320px; background: rgba(20,22,30,0.96); backdrop-filter: blur(8px); border-right: 1px solid var(--border); flex-direction: column; z-index: 8; }
.int-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); font-weight: 800; font-size: 14px; }
.int-close { width: 26px; height: 26px; border: 1px solid var(--border); background: var(--surface2); color: var(--text); border-radius: 6px; cursor: pointer; font-size: 13px; }
.int-close:hover { border-color: var(--accent2); color: var(--accent2); }
.int-tabs { display: flex; gap: 4px; padding: 10px 12px 0; flex-wrap: wrap; }
.int-tab { padding: 7px 10px; border: 1px solid var(--border); background: transparent; color: var(--text2); border-radius: 7px; font-family: inherit; font-size: 11.5px; font-weight: 700; cursor: pointer; }
.int-tab.active { background: rgba(245,166,35,0.16); border-color: var(--accent); color: var(--accent); }
.int-body { flex: 1; overflow-y: auto; padding: 14px 16px; }
.int-body::-webkit-scrollbar { width: 4px; } .int-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.int-render { margin: 0 12px 12px; padding: 11px; border: none; border-radius: 9px; background: linear-gradient(135deg,#a78bfa,#7c5cff); color: #fff; font-family: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
.int-render:hover { opacity: 0.92; }
.int-h { font-size: 14px; font-weight: 800; margin-bottom: 4px; }
.int-sub { font-size: 11.5px; color: var(--text3); line-height: 1.5; margin-bottom: 12px; }
.int-sub b { color: var(--text2); }
.int-label { font-size: 11px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: 0.4px; margin: 14px 0 8px; }
.int-roomsel { width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-family: inherit; font-size: 13px; padding: 9px 11px; outline: none; margin-bottom: 4px; }
.int-roomsel:focus { border-color: var(--accent); }
/* tema */
.int-theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.int-theme { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 12px 8px; border: 1px solid var(--border); background: var(--surface2); border-radius: 10px; cursor: pointer; transition: all 0.15s; }
.int-theme:hover { border-color: var(--accent); transform: translateY(-1px); }
.int-theme.active { border-color: var(--accent); background: rgba(245,166,35,0.1); }
.int-theme-emo { font-size: 22px; }
.int-theme-name { font-size: 11.5px; font-weight: 700; color: var(--text); }
.int-theme-sw { display: flex; gap: 3px; }
.int-theme-sw i { width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(255,255,255,0.15); }
.int-reset { width: 100%; margin-top: 12px; padding: 9px; border: 1px solid var(--border); background: var(--surface2); color: var(--text2); border-radius: 8px; font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.int-reset:hover { border-color: var(--accent2); color: var(--accent2); }
/* swatches */
.int-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.int-sw { width: 30px; height: 30px; border-radius: 7px; border: 2px solid transparent; box-shadow: 0 0 0 1px var(--border); cursor: pointer; padding: 0; position: relative; }
.int-sw.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.int-sw-custom { display: flex; align-items: center; justify-content: center; overflow: hidden; }
.int-sw-custom::after { content: '🎨'; font-size: 13px; }
.int-sw-custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
/* floor material list */
.int-mat-list { display: flex; flex-direction: column; gap: 5px; }
.int-mat { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border: 1px solid var(--border); background: var(--surface2); border-radius: 8px; cursor: pointer; text-align: left; }
.int-mat:hover { border-color: var(--accent); }
.int-mat.active { border-color: var(--accent); background: rgba(245,166,35,0.1); }
.int-mat i { width: 22px; height: 22px; border-radius: 5px; box-shadow: 0 0 0 1px var(--border); flex-shrink: 0; }
.int-mat span { flex: 1; font-size: 12px; font-weight: 600; color: var(--text); }
.int-mat b { font-size: 10px; color: var(--text3); font-family: 'Space Mono', monospace; }
.int-check { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text2); margin-top: 14px; cursor: pointer; line-height: 1.4; }
.int-apply-all { width: 100%; margin-top: 14px; padding: 9px; border: 1px solid var(--accent); background: rgba(245,166,35,0.1); color: var(--accent); border-radius: 8px; font-family: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.int-apply-all:hover { background: rgba(245,166,35,0.18); }
/* furnitur */
.int-fcats { display: flex; gap: 4px; flex-wrap: wrap; margin: 10px 0; }
.int-fcat { padding: 4px 9px; border-radius: 14px; border: 1px solid var(--border); background: transparent; color: var(--text2); font-size: 10.5px; font-weight: 600; cursor: pointer; }
.int-fcat.active { background: rgba(245,166,35,0.15); border-color: var(--accent); color: var(--accent); }
.int-fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.int-fcard { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 6px; border: 1px solid var(--border); background: var(--surface2); border-radius: 8px; cursor: pointer; }
.int-fcard:hover { border-color: var(--accent); transform: translateY(-1px); }
.int-fcard span { font-size: 20px; }
.int-fcard div { font-size: 9.5px; font-weight: 600; color: var(--text2); line-height: 1.25; text-align: center; }
.int-sel-actions { margin-top: 12px; padding: 10px; border: 1px solid var(--accent); border-radius: 9px; background: rgba(245,166,35,0.08); }
.int-sel-name { font-size: 12px; font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.int-sel-row { display: flex; gap: 6px; }
.int-sel-row button { flex: 1; padding: 7px 4px; border: 1px solid var(--border); background: var(--surface2); color: var(--text2); border-radius: 7px; font-family: inherit; font-size: 11px; font-weight: 600; cursor: pointer; }
.int-sel-row button:hover { border-color: var(--accent); color: var(--accent); }
.int-sel-row button.danger:hover { border-color: var(--accent2); color: var(--accent2); }
/* cahaya */
.int-light-grid { display: flex; flex-direction: column; gap: 8px; }
.int-light { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--border); background: var(--surface2); border-radius: 9px; cursor: pointer; text-align: left; }
.int-light:hover { border-color: var(--accent); }
.int-light.active { border-color: var(--accent); background: rgba(245,166,35,0.1); }
.int-light span { font-size: 13px; font-weight: 700; color: var(--text); }
.int-light small { font-size: 11px; color: var(--text3); }
/* rab */
.int-rab { width: 100%; border-collapse: collapse; margin-bottom: 6px; }
.int-rab td { padding: 6px 4px; border-bottom: 1px solid var(--border); font-size: 11.5px; color: var(--text2); }
.int-rab td:nth-child(2) { text-align: center; color: var(--text3); white-space: nowrap; }
.int-rab td:nth-child(3) { text-align: right; font-family: 'Space Mono', monospace; color: var(--text); white-space: nowrap; }
.int-rab-total { display: flex; align-items: center; justify-content: space-between; margin: 12px 0 6px; padding: 12px; background: rgba(245,166,35,0.1); border: 1px solid var(--accent); border-radius: 9px; }
.int-rab-total span { font-size: 12px; font-weight: 700; color: var(--text); }
.int-rab-total b { font-size: 16px; font-family: 'Space Mono', monospace; color: var(--accent); }

@media (max-width: 820px) {
  #interiorPanel { width: 100%; }
}

