/* Görüntüleyici: tam ekran uygulama düzeni (üst çubuk, sahne, alt çubuk). */
body.app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }

.bar {
  display: flex; align-items: center; gap: 8px; padding: 6px 12px;
  background: var(--card); border-color: var(--line); flex: none; min-height: 44px;
}
.bar.top { border-bottom: 1px solid var(--line); }
.bar.bottom { border-top: 1px solid var(--line); font-size: 13px; }
.bar .brand { font-size: 15px; margin-right: 6px; }
.bar .brand img { width: 24px; height: 24px; }
.bar .title { font-weight: 600; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.spacer { flex: 1; }
.status { color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

.tool {
  font: inherit; font-size: 13px; color: var(--text); background: transparent; cursor: pointer;
  border: 1px solid var(--line); border-radius: 7px; padding: 5px 10px; white-space: nowrap;
}
.tool:hover { background: color-mix(in srgb, var(--brand) 10%, transparent); }
.tool.on { background: #2b6cd8; border-color: #2b6cd8; color: #fff; }
.tool:disabled { opacity: .45; cursor: default; }

.tones { display: flex; gap: 6px; margin-left: 6px; }
.tone { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; outline-offset: 2px; }
.tone.on { border-color: var(--text); }

#stage { position: relative; flex: 1; min-height: 0; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

.drop {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 16px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
}
.drop.hover { outline: 3px dashed #2b6cd8; outline-offset: -14px; }
.drop[hidden] { display: none; }
.drop-box { text-align: center; max-width: 520px; }
.drop-box h2 { margin: 12px 0 6px; }
.drop-box p { color: var(--sub); margin: 0 0 18px; }
.drop-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }

.library { margin-top: 24px; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.library h3 { margin: 0 0 8px; font-size: 15px; }
.library ul { list-style: none; margin: 0; padding: 0; max-height: 240px; overflow: auto; }
.library li button {
  width: 100%; text-align: left; font: inherit; font-size: 14px; color: var(--text); background: none; border: 0;
  padding: 6px 4px; border-radius: 6px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px;
}
.library li button:hover { background: color-mix(in srgb, var(--brand) 10%, transparent); }
.library li small { color: var(--sub); white-space: nowrap; }

.busy {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 18px; box-shadow: 0 8px 30px rgba(0, 0, 0, .15);
}
.busy[hidden] { display: none; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line); border-top-color: #2b6cd8; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.info {
  position: absolute; right: 12px; top: 12px; width: min(340px, calc(100% - 24px)); max-height: calc(100% - 24px); overflow: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 13px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .12);
}
.info[hidden] { display: none; }
.info .close { position: absolute; right: 8px; top: 4px; border: 0; background: none; font-size: 20px; color: var(--sub); cursor: pointer; }
.info-name { font-weight: 700; padding-right: 20px; margin-bottom: 6px; word-break: break-word; }
.info dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; }
.info dt { color: var(--sub); }
.info dd { margin: 0; word-break: break-word; }

@media (max-width: 640px) {
  .bar.top .brand span, .status { display: none; }
}

.tool[hidden], .clashpos[hidden] { display: none; }
.clashpos { font-size: 13px; color: var(--sub); min-width: 52px; text-align: center; white-space: nowrap; }
.drop-box .keys { font-size: 13px; margin-top: -8px; }
.info .partners { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.info .partners b { display: block; margin-bottom: 4px; color: #c2410c; }
.info .partners button { display: block; width: 100%; text-align: left; font: inherit; font-size: 12px; color: var(--text); background: none; border: 0; padding: 3px 2px; border-radius: 5px; cursor: pointer; }
.info .partners button:hover { background: color-mix(in srgb, var(--brand) 10%, transparent); }

.legend { position: absolute; left: 12px; top: 12px; background: color-mix(in srgb, var(--card) 92%, transparent); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 10px; font-size: 12px; max-width: min(360px, calc(100% - 24px)); max-height: 40%; overflow: auto; }
.legend[hidden] { display: none; }
.legend div { display: flex; align-items: center; gap: 8px; padding: 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend i { width: 12px; height: 12px; border-radius: 50%; flex: none; border: 1px solid rgba(0, 0, 0, .15); }

.info .hide-btn { margin-top: 8px; }

/* Çakışma listesi: elemana göre gruplar */
.clashlist { position: absolute; left: 12px; bottom: 12px; top: 12px; width: min(360px, calc(100% - 24px)); display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 30px rgba(0, 0, 0, .12); font-size: 13px; z-index: 2; }
.clashlist[hidden] { display: none; }
.cl-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.cl-head .close { border: 0; background: none; font-size: 20px; color: var(--sub); cursor: pointer; }
.cl-body { overflow: auto; padding: 6px; }
.cl-group { border-radius: 8px; margin-bottom: 4px; }
.cl-group.on { background: color-mix(in srgb, #e11dd8 8%, transparent); }
.cl-group > button, .cl-item { width: 100%; text-align: left; font: inherit; color: var(--text); background: none; border: 0; cursor: pointer;
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; }
.cl-group > button:hover, .cl-item:hover { background: color-mix(in srgb, var(--brand) 10%, transparent); }
.cl-group > button .n { margin-left: auto; font-size: 12px; font-weight: 700; color: #fff; background: #ff1414; border-radius: 99px; padding: 1px 8px; }
.cl-group > button .arrow { width: 12px; color: var(--sub); }
.cl-items { padding-left: 20px; }
.cl-items[hidden] { display: none; }
.cl-item { font-size: 12px; padding: 4px 8px; }
.cl-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.cl-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Yazılım çizici uyarısı (tarayıcı ekran kartını kullanmıyor) */
.gpu-warn { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); width: min(720px, calc(100% - 32px));
  background: #fff4e5; color: #5a3500; border: 1px solid #f0b46b; border-radius: 10px; padding: 10px 36px 10px 14px;
  font-size: 13px; line-height: 1.5; z-index: 20; box-shadow: 0 6px 20px rgba(0,0,0,.15); }
.gpu-warn code { background: rgba(0,0,0,.07); padding: 0 4px; border-radius: 4px; }
.gpu-warn button { position: absolute; right: 8px; top: 6px; border: 0; background: none; color: inherit; font-size: 15px; cursor: pointer; }
.gpu-warn a { color: #8a4b00; font-weight: 600; }

/* Çakışma grupları seçimi */
.clashset { position: absolute; right: 12px; bottom: 12px; width: min(340px, calc(100% - 24px)); background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 8px 30px rgba(0, 0, 0, .14); padding: 12px 14px; font-size: 13px; z-index: 3; display: flex; flex-direction: column; gap: 6px; }
.clashset[hidden] { display: none; }
.clashset label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.clashset small { color: var(--sub); line-height: 1.45; margin-top: 4px; }
.cl-head { gap: 8px; }
.cl-head b { margin-right: auto; }
.cl-report { font: inherit; font-size: 12px; border: 1px solid var(--line); background: none; color: var(--text); border-radius: 8px; padding: 3px 8px; cursor: pointer; white-space: nowrap; }
.cl-report:hover { background: color-mix(in srgb, var(--brand) 10%, transparent); }
.cl-sec { margin-bottom: 6px; }
.cl-sec-row { display: flex; gap: 4px; align-items: stretch; }
.cl-sec-row > button:first-child { flex: 1; min-width: 0; display: flex; gap: 8px; align-items: center; font: inherit; font-weight: 600; text-align: left; color: var(--text);
  background: color-mix(in srgb, var(--brand) 7%, transparent); border: 0; border-radius: 8px; padding: 7px 8px; cursor: pointer; }
.cl-sec-row > button:first-child .n { margin-left: auto; font-size: 12px; color: var(--sub); white-space: nowrap; }
.cl-sec-row > button:first-child .pair { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-ren { flex: none; font: inherit; border: 1px solid var(--line); background: none; color: var(--sub); border-radius: 8px; padding: 0 8px; cursor: pointer; }
.cl-ren:hover { color: var(--text); background: color-mix(in srgb, var(--brand) 10%, transparent); }
.cl-ren-in { flex: 1; min-width: 0; font: inherit; font-weight: 600; color: var(--text); background: var(--bg, transparent); border: 1px solid var(--brand); border-radius: 8px; padding: 6px 8px; }
.cl-sec-body { padding: 4px 0 0 6px; }
.cl-sec-body[hidden] { display: none; }

/* Kullanıcı ışıkları */
.lights { position: absolute; left: 12px; top: 12px; width: min(320px, calc(100% - 24px)); max-height: calc(100% - 24px); overflow: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 30px rgba(0, 0, 0, .12);
  padding: 10px 12px; font-size: 13px; z-index: 3; display: flex; flex-direction: column; gap: 8px; }
.lights[hidden] { display: none; }
.lp-head { display: flex; align-items: center; justify-content: space-between; }
.lp-head .close { border: 0; background: none; font-size: 20px; color: var(--sub); cursor: pointer; }
.lp-add { display: flex; gap: 6px; }
.lp-add .tool.on { outline: 2px solid var(--brand); }
.lp-row { display: grid; grid-template-columns: 110px 1fr 58px; align-items: center; gap: 8px; }
.lp-row output { text-align: right; color: var(--sub); font-variant-numeric: tabular-nums; }
.lp-row input[type=range] { width: 100%; }
.lp-list { display: flex; flex-direction: column; gap: 2px; }
.lp-list button { display: flex; gap: 8px; align-items: center; width: 100%; text-align: left; font: inherit; color: var(--text); background: none;
  border: 0; border-radius: 8px; padding: 5px 8px; cursor: pointer; }
.lp-list button:hover { background: color-mix(in srgb, var(--brand) 10%, transparent); }
.lp-list button.on { background: color-mix(in srgb, var(--brand) 16%, transparent); font-weight: 600; }
.lp-list i { width: 12px; height: 12px; border-radius: 50%; flex: none; border: 1px solid rgba(0, 0, 0, .2); }
.lp-edit { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); padding-top: 8px; }
.lp-edit:empty { display: none; }
.lp-edit .btns { display: flex; gap: 6px; }
.lp-note { color: var(--sub); line-height: 1.45; }
.lp-k { background: linear-gradient(90deg, #ffb46b, #ffe4c4, #fff6ed, #e8eeff); border-radius: 99px; }
.lp-check { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; line-height: 1.4; }
.lp-row input[type=color] { width: 100%; height: 26px; border: 1px solid var(--line); border-radius: 6px; background: none; padding: 1px; }

/* Çakışma: Gruplar / Ayrıntılı (Revit kategorileri) */
.clashset.wide { width: min(560px, calc(100% - 24px)); }
.cs-tabs { display: flex; gap: 4px; padding: 2px; border-radius: 9px; background: color-mix(in srgb, var(--brand) 8%, transparent); }
.cs-tabs button { flex: 1; font: inherit; font-size: 12.5px; border: 0; border-radius: 7px; padding: 5px 8px; background: none; color: var(--sub); cursor: pointer; }
.cs-tabs button.on { background: var(--card); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.cs-groups, .cs-detail { display: flex; flex-direction: column; gap: 6px; }
.cs-groups[hidden], .cs-detail[hidden] { display: none; }
.cs-search { font: inherit; color: var(--text); background: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; }
.cs-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cs-col { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cs-colhead { display: flex; align-items: center; justify-content: space-between; }
.cs-clear { font: inherit; font-size: 11.5px; border: 0; background: none; color: var(--brand); cursor: pointer; padding: 0; }
.cs-list { max-height: min(300px, 40vh); overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 4px 6px; display: flex; flex-direction: column; gap: 2px; }
.cs-list label { font-size: 12.5px; }
.cs-list label span:not(.n) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-list label .n { margin-left: auto; color: var(--sub); font-size: 11.5px; }
@media (max-width: 520px) { .cs-cols { grid-template-columns: 1fr; } }

/* Ortam: gündüz/gece + arka plan */
.envpanel { width: min(300px, calc(100% - 24px)); }
.env-bgs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.env-bgs button { font: inherit; font-size: 12.5px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: none; color: var(--text); cursor: pointer; }
.env-bgs button.on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); font-weight: 600; }
.env-row { display: flex; gap: 12px; align-items: center; }
.env-row[hidden] { display: none; }
.env-row label { display: flex; gap: 6px; align-items: center; }
.env-row input[type=color] { width: 40px; height: 26px; border: 1px solid var(--line); border-radius: 6px; padding: 1px; background: none; cursor: pointer; }

/* Çoklu seçim: benzerleri / ada göre */
.msel { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 4; display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
  max-width: calc(100% - 24px); background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 30px rgba(0, 0, 0, .14); padding: 6px 8px; font-size: 13px; }
.msel[hidden] { display: none; }
.msel input { font: inherit; color: var(--text); background: none; border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; width: min(260px, 60vw); }
.msel b { white-space: nowrap; padding: 0 4px; }
.msel .tool:disabled { opacity: .45; cursor: default; }
.info .similar { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 8px; font-size: 12px; color: var(--sub); }
.info .similar button { font: inherit; font-size: 12px; color: var(--text); border: 1px solid var(--line); background: none; border-radius: 999px; padding: 2px 9px; cursor: pointer; }
.info .similar button:hover { background: color-mix(in srgb, var(--brand) 10%, transparent); }

.env-slider span { width: 70px; flex: none; }
.env-slider input { flex: 1; min-width: 0; }
.env-slider output { width: 40px; text-align: right; color: var(--sub); font-variant-numeric: tabular-nums; }

/* 🎨 Malzeme (Pro) */
.matpanel { width: min(340px, calc(100% - 24px)); }
.pro { font-style: normal; font-size: 10px; font-weight: 700; letter-spacing: .04em; color: #fff; background: linear-gradient(90deg, #7c3aed, #db2777); border-radius: 4px; padding: 1px 5px; vertical-align: 2px; }
.mp-body { display: flex; flex-direction: column; gap: 8px; }
.mp-body[hidden], .mp-lock[hidden] { display: none; }
.mp-target { line-height: 1.45; }
.mp-target .similar { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.mp-target .similar button, .mp-btns button { font: inherit; font-size: 12px; color: var(--text); border: 1px solid var(--line); background: none; border-radius: 999px; padding: 2px 9px; cursor: pointer; }
.mp-target .similar button:hover, .mp-btns button:hover { background: color-mix(in srgb, var(--brand) 10%, transparent); }
.mp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 4px; }
.mp-grid button { display: flex; flex-direction: column; align-items: center; gap: 3px; font: inherit; font-size: 11px; line-height: 1.2; color: var(--text); background: none;
  border: 1px solid var(--line); border-radius: 8px; padding: 5px 3px; cursor: pointer; text-align: center; }
.mp-grid button:hover { background: color-mix(in srgb, var(--brand) 8%, transparent); }
.mp-grid button.on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); font-weight: 600; }
.mp-sw { width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .15); background-size: cover; background-position: center; }
.mp-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.mp-sec { font-weight: 600; margin-top: 2px; }
.mp-lock { display: flex; flex-direction: column; gap: 8px; line-height: 1.45; }
.mp-lock input { font: inherit; color: var(--text); background: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; }
.mp-lock .row { display: flex; gap: 6px; }
.mp-lock .row input { flex: 1; min-width: 0; }
.mp-lock .msg { color: var(--sub); }
.mp-lock .msg.err { color: #c62828; }
.mp-foot { color: var(--sub); font-size: 12px; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.mp-foot a { color: var(--sub); }
.mp-list { display: flex; flex-direction: column; gap: 2px; }
.mp-row { display: flex; gap: 8px; align-items: center; width: 100%; text-align: left; font: inherit; color: var(--text); background: none;
  border: 1px solid transparent; border-radius: 8px; padding: 4px 6px; cursor: pointer; }
.mp-row:hover { background: color-mix(in srgb, var(--brand) 8%, transparent); }
.mp-row.on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); font-weight: 600; }
.mp-row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-row small { color: var(--sub); font-weight: 400; }
.mp-sw.sm { width: 20px; height: 20px; flex: none; }
.mp-edit { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
.mp-name { font: inherit; font-weight: 600; color: var(--text); background: none; border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; min-width: 0; }
.lp-row:has(.mp-name) { grid-template-columns: 110px 1fr; }
