* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  color: #172033;
  background: #edf3f9;
}

.nav {
  height: 56px;
  background: #fff;
  border-bottom: 1px solid #dbe6f2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.logo {
  font-weight: 900;
  color: #185fa5;
  text-decoration: none;
  font-size: 22px;
}

.nav-links {
  display: flex;
  gap: 20px;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: #26364d;
  font-weight: 700;
}

.nav-btn,
.primary {
  background: #1769b2;
  color: #fff !important;
  padding: 10px 16px;
  border-radius: 12px;
  text-decoration: none;
}

.trial {
  background: #fff2cc;
  color: #9a5200;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 800;
}

.flash {
  max-width: 900px;
  margin: 10px auto;
  background: #fee2e2;
  color: #991b1b;
  padding: 10px 14px;
  border-radius: 12px;
}

.landing {
  max-width: 900px;
  margin: 80px auto;
  text-align: center;
}

.landing h1 {
  font-size: 48px;
}

.landing p {
  font-size: 20px;
  color: #5d6f89;
}

.pill {
  display: inline-block;
  background: #e6f1fb;
  color: #185fa5;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 800;
}

.auth {
  min-height: calc(100vh - 56px);
  display: grid;
  place-items: center;
}

.card {
  width: 420px;
  background: white;
  padding: 28px;
  border: 1px solid #dbe6f2;
  border-radius: 22px;
  box-shadow: 0 12px 40px rgba(15, 39, 74, .08);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card label {
  font-weight: 800;
}

.card input {
  width: 100%;
  margin-top: 7px;
  border: 1px solid #cbd8e8;
  border-radius: 12px;
  padding: 12px;
}

.card button {
  background: #1769b2;
  color: white;
  border: 0;
  border-radius: 12px;
  padding: 12px;
  font-weight: 900;
}

.dash {
  max-width: 900px;
  margin: 40px auto;
}

.dash-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.small {
  padding: 9px 12px;
}

.project-row,
.empty {
  background: white;
  border: 1px solid #dbe6f2;
  border-radius: 16px;
  margin: 12px 0;
  padding: 18px;
  display: flex;
  justify-content: space-between;
}

.project-row span {
  color: #64748b;
}

/* ANA PROJE EKRANI */

.project-app {
  height: calc(100vh - 56px);
  display: grid;
  grid-template-columns: 330px minmax(680px, 1fr) 310px;
  overflow: hidden;
}

.left-panel,
.right-panel {
  background: white;
  border-right: 1px solid #dbe6f2;
  overflow: auto;
  padding: 16px;
}

.right-panel {
  border-right: 0;
  border-left: 1px solid #dbe6f2;
}

.left-panel h3 {
  font-size: 13px;
  color: #334155;
  margin: 18px 0 9px;
}

.field-label {
  font-size: 12px;
  font-weight: 900;
  color: #334155;
}

.field-label input,
.left-panel select,
#etsVersion {
  width: 100%;
  border: 1px solid #bdd6f5;
  border-radius: 10px;
  padding: 9px;
  background: #fff;
  font-weight: 700;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.tab {
  border: 1px solid #93c5fd;
  background: #eff6ff;
  color: #185fa5;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
}

.tab.active {
  background: #1769b2;
  color: #fff;
}

.two,
.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.soft,
.blue,
.green {
  border: 0;
  border-radius: 14px;
  padding: 11px 12px;
  font-weight: 900;
  cursor: pointer;
}

.soft {
  background: #edf2f8;
  color: #26364d;
}

.blue {
  background: #1769b2;
  color: #fff;
}

.green {
  background: #0f806f;
  color: #fff;
}

.device-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.device-btn {
  background: #fff;
  border: 1px solid #bdd6f5;
  border-radius: 15px;
  padding: 12px 14px;
  text-align: left;
  font-weight: 900;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.device-btn small {
  color: #64748b;
}

.status-box {
  background: #f8fbff;
  border: 1px solid #dbe6f2;
  border-radius: 18px;
  padding: 14px;
  margin-top: 18px;
}

.status-box h2 {
  margin: 0 0 8px;
}

/* ORTA ÇİZİM ALANI */

.center-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.project-toolbar {
  min-height: 106px;
  flex: 0 0 auto;
  background: white;
  border-bottom: 1px solid #dbe6f2;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  padding: 12px 24px;
  z-index: 10;
}

.toolbar-title {
  flex: 1 1 180px;
}

.toolbar-title h1 {
  margin: 0;
  font-size: 26px;
}

.toolbar-title p {
  margin: 5px 0 0;
  color: #64748b;
}

.stats {
  display: flex;
  gap: 10px;
}

.stats div {
  background: #f1f5f9;
  border-radius: 18px;
  padding: 12px 18px;
  text-align: center;
}

.stats b {
  display: block;
  font-size: 24px;
}

.stats span {
  font-size: 12px;
  color: #64748b;
  font-weight: 900;
}

.zoom-box {
  height: 48px;
  background: #f8fbff;
  border: 1px solid #dbe6f2;
  border-radius: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
}

.zoom-box button {
  border: 0;
  background: #e8eef7;
  border-radius: 10px;
  min-width: 38px;
  height: 34px;
  font-weight: 900;
}

.zoom-box input {
  width: 160px;
}

#etsVersion {
  width: 110px;
}

.workspace-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 28px;
  background: #e8eef5;
}

.zoom-content {
  transform-origin: top left;
  transition: transform .15s ease;
  width: 1320px;
}

.drawing-sheet {
  background: #fff;
  border: 1px solid #cbd8e8;
  border-radius: 18px;
  padding: 16px;
  width: 1280px;
  min-height: 820px;
}

.sheet-title {
  font-weight: 900;
  margin-bottom: 12px;
}

.sheet-grid {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 24px;
}

.rooms-canvas,
.collectors-canvas {
  min-height: 170px;
  border: 1px solid #cbd8e8;
  border-radius: 14px;
  padding: 12px;
  background: #fbfdff;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-content: flex-start;
}

.collectors-canvas {
  min-height: 90px;
}

.room-card,
.collector-card {
  border: 1px solid #84bfff;
  background: #eff6ff;
  border-radius: 12px;
  padding: 10px;
  width: 145px;
  min-height: 98px;
}

.room-card h5,
.collector-card h5 {
  margin: 0 0 8px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chips {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.chip {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  font-size: 12px;
  font-weight: 900;
}

.c-light { background: #f59e0b; }
.c-dim { background: #9333ea; }
.c-curtain { background: #0ea5e9; }
.c-valve { background: #0f766e; }
.c-thermostat { background: #ef4444; }
.c-switch { background: #475569; }
.c-sensor { background: #64748b; }

#panelCanvas {
  width: 980px;
  height: 720px;
  border: 1px solid #94a3b8;
  border-radius: 16px;
  background: white;
}

/* GRUP ADRESLERİ */

.ga-item {
  border-bottom: 1px solid #dbe6f2;
  padding: 11px 0;
}

.ga-addr {
  display: inline-block;
  background: #e6f1fb;
  color: #1769b2;
  font-weight: 900;
  border-radius: 999px;
  padding: 4px 9px;
}

.ga-name {
  font-weight: 800;
  margin-top: 4px;
}

.ga-dpt {
  color: #7b8ca5;
  font-size: 12px;
  font-weight: 800;
}

/* MODAL */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  display: grid;
  place-items: center;
  z-index: 99;
}

.hidden {
  display: none;
}

.modal-card {
  background: #fff;
  border-radius: 22px;
  padding: 22px;
  width: 430px;
  max-width: 95vw;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .25);
}

.modal-card label {
  display: block;
  font-weight: 900;
  margin: 12px 0;
}

.modal-card input,
.modal-card select {
  width: 100%;
  border: 1px solid #cbd8e8;
  border-radius: 12px;
  padding: 11px;
  margin-top: 6px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

/* v18: PROJE SAĞLIĞI */

.health {
  font-weight: 900;
  padding: 10px 12px;
  border-radius: 12px;
  margin: 10px 0;
}

.health.ok { background: #dcfce7; color: #166534; }
.health.warn { background: #ffedd5; color: #9a3412; }
.health.error { background: #fee2e2; color: #991b1b; }

.line-row {
  font-size: 12px;
  color: #334155;
  background: #fff;
  border: 1px solid #dbe6f2;
  border-radius: 10px;
  padding: 8px 10px;
  margin: 6px 0;
}

.issue {
  display: flex;
  gap: 8px;
  font-size: 12px;
  line-height: 1.35;
  padding: 7px 0;
  border-top: 1px dashed #dbe6f2;
}

.issue.error div { color: #991b1b; }
.issue.warn div { color: #9a3412; }

.rp-title {
  margin: 4px 0 0;
  font-size: 18px;
}

.rp-hint {
  margin: 2px 0 8px;
  font-size: 12px;
  color: #64748b;
}

#paList {
  margin-bottom: 18px;
}

.ga-addr.pa {
  background: #dcfce7;
  color: #0f766e;
}

.ga-group {
  margin-top: 12px;
  padding: 6px 8px;
  background: #f1f5f9;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 900;
  color: #334155;
}

.empty-mini {
  color: #94a3b8;
  font-size: 13px;
}

/* ================================
   v19 EDİTÖR (sürükle-bırak + kablo)
   ================================ */

.ed { display: flex; flex-direction: column; height: calc(100vh - 56px); }

.ed-top {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 6px 12px; background: #fff; border-bottom: 1px solid #dbe6f2;
}
.ed-name {
  font-weight: 800; color: #185fa5; border: 1px solid transparent;
  border-radius: 8px; padding: 5px 8px; font-size: 14px; min-width: 180px;
}
.ed-name:hover, .ed-name:focus { border-color: #cbd5e1; outline: none; }
.ed-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.ed-tab {
  font-size: 12px; padding: 4px 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid #cbd5e1; background: #fff; color: #475569;
}
.ed-tab.active { background: #185fa5; color: #fff; border-color: #185fa5; }
.ed-top-right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.ed-dirty { font-size: 12px; color: #64748b; }

.ed-soft, .ed-blue, .ed-green {
  font-size: 12px; padding: 6px 12px; border-radius: 9px; cursor: pointer;
  font-weight: 700; border: 1px solid #cbd5e1; background: #fff; color: #26364d;
}
.ed-blue { background: #1769b2; border-color: #1769b2; color: #fff; }
.ed-green { background: #15803d; border-color: #15803d; color: #fff; }

.ed-body { flex: 1; display: flex; min-height: 0; }


.ed-center { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ed-hint { font-size: 12px; font-weight: 700; color: #185fa5; }
.ed-scroller { flex: 1; overflow: auto; background: #f7f7f5; }
.ed-stage { position: relative; width: 2400px; height: 1600px; }
.ed-cv {
  position: absolute; inset: 0;
  background-image: radial-gradient(#d9dee5 1px, transparent 1px);
  background-size: 18px 18px;
}
.ed-stage[data-tool="room"] .ed-cv,
.ed-stage[data-tool="panel"] .ed-cv,
.ed-stage[data-tool="collector"] .ed-cv { cursor: crosshair; }
.ed-wc { position: absolute; top: 0; left: 0; pointer-events: none; z-index: 5; }
.ed-empty {
  position: absolute; left: 40px; top: 40px; padding: 14px 18px; border-radius: 12px;
  background: #fff; border: 1px dashed #94a3b8; color: #475569; font-size: 13px;
}
.ed-legend {
  display: flex; gap: 16px; padding: 5px 12px; font-size: 11px; color: #64748b;
  background: #fff; border-top: 1px solid #dbe6f2;
}
.lg { display: inline-block; width: 22px; height: 3px; vertical-align: middle; margin-right: 4px; }
.lg-energy { background: #8B4513; }
.lg-bus { background: #16a34a; height: 4px; }
#cableCount { margin-left: auto; }

/* oda */
.rbox {
  position: absolute; z-index: 2; border: 2px solid #185fa5; border-radius: 9px;
  background: rgba(230,241,251,.55);
}
.rhdr, .phdr, .chdr {
  display: flex; justify-content: space-between; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 800; padding: 5px 8px; cursor: move; user-select: none;
  border-radius: 7px 7px 0 0;
}
.rhdr {
  background: #185fa5; color: #fff; font-size: 15px; letter-spacing: .01em;
  padding: 7px 10px; border-bottom: none;
}
.rhdr small { color: #dbeafe; }
.rhdr small, .chdr small { font-weight: 700; font-size: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 3px; padding: 6px; min-height: 36px; }
.dchip {
  display: inline-flex; flex-direction: column; align-items: center; gap: 1px;
  min-width: 40px; padding: 4px 5px; border-radius: 8px; background: #fff; cursor: pointer;
  border: 1.5px solid #fac775; font-size: 9px; color: #854f0b;
}
.dchip.knx { border-color: #86efac; color: #166534; }
.dchip .ic { font-size: 15px; line-height: 1; }
.dchip:hover { transform: scale(1.06); }
.addbtn {
  width: 100%; padding: 5px; font-size: 11px; font-weight: 700; color: #185fa5; cursor: pointer;
  background: transparent; border: none; border-top: 1px solid rgba(24,95,165,.12);
}

/* pano */
.pbox {
  position: absolute; z-index: 2; min-width: 200px; background: #fff;
  border: 2px solid #5f5e5a; border-radius: 9px; box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.phdr { background: #f5f5f0; border-bottom: 1px solid #ddd; color: #333; }
.busport {
  font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 6px; cursor: pointer;
  border: 1.5px solid #16a34a; background: #f0fff4; color: #15803d;
}
.prod { border-bottom: 1px solid #eee; }
.ptitle { font-size: 11px; font-weight: 700; color: #444; padding: 4px 8px 2px; background: #fafafa; }
.klemens {
  display: flex; align-items: center; gap: 4px; padding: 2px 8px; font-size: 9px; color: #666;
}
.klemens.ps { background: #f0fff4; color: #15803d; font-weight: 700; }
.klemens i {
  width: 11px; height: 14px; border-radius: 2px; color: #fff; font-style: normal;
  font-size: 8px; display: inline-flex; align-items: center; justify-content: center;
}
.klemens .minus { background: #111827; }
.klemens .plus { background: #dc2626; }
.klemens em { font-style: normal; color: #16a34a; font-weight: 700; }
.chgrid { display: grid; gap: 3px; padding: 5px 8px 7px; }
.chbtn {
  width: 28px; height: 36px; border-radius: 6px; cursor: pointer; font-size: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 1.5px solid #cbd5e1; background: #fff; color: #64748b; padding: 0;
}
.chbtn span { font-size: 8px; font-weight: 800; }
.chbtn:hover { border-color: #185fa5; }
.chbtn.used { background: #faeeda; border-color: #fac775; color: #854f0b; }
.chbtn.used.c-dim { background: #e6f1fb; border-color: #85b7eb; }
.chbtn.used.c-curtain { background: #e1f5ee; border-color: #5dcaa5; }
.chbtn.used.c-valve { background: #fdecec; border-color: #fca5a5; }
.chbtn.blocked { background: #e5e7eb; border-color: #cbd5e1; color: #6b7280; }
.pempty { padding: 8px; font-size: 11px; color: #94a3b8; }

/* kollektör */
.cbox {
  position: absolute; z-index: 2; background: #fff; border: 2px solid #dc2626; border-radius: 9px;
}
.chdr { background: #fef2f2; color: #dc2626; border-bottom: 1px solid #fca5a5; }
.vanas { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; }
.vana {
  width: 36px; height: 44px; border: 1.5px solid #dc2626; border-radius: 6px; background: #fff;
  display: flex; flex-direction: column; align-items: center; cursor: pointer; padding: 0; overflow: hidden;
}
.vana b { width: 100%; background: #dc2626; color: #fff; font-size: 7px; padding: 1px 0; }
.vana i { width: 10px; height: 10px; border-radius: 50%; background: #dc2626; margin: 4px 0 2px; }
.vana span { font-size: 8px; color: #dc2626; font-weight: 800; }
.cnote { font-size: 9px; color: #dc2626; padding: 3px 8px; background: #fef2f2; border-top: 1px solid #fca5a5; }

/* seçili öğe */
.picked { box-shadow: 0 0 0 3px #185fa5 !important; border-color: #185fa5 !important; }

/* sağ panel */
.ed-right {
  width: 300px; flex-shrink: 0; overflow-y: auto; padding: 12px;
  background: #fff; border-left: 1px solid #dbe6f2;
}
.ed-right h3 { margin: 14px 0 4px; font-size: 15px; }
.ed-right h3:first-child { margin-top: 0; }

/* modal içi */
.devgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.devbtn {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px;
  border-radius: 10px; border: 1.5px solid #e2e8f0; background: #fff; cursor: pointer; font-size: 11px;
}
.devbtn .ic { font-size: 20px; }
.devbtn small.e { color: #8B4513; font-weight: 700; }
.devbtn small.k { color: #15803d; font-weight: 700; }
.devbtn.on { border-color: #185fa5; background: #e6f1fb; }
.pgroup { margin-bottom: 8px; }
.pcat { font-size: 11px; font-weight: 800; color: #64748b; margin: 4px 0; text-transform: uppercase; }
.prodbtn {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 8px 10px; margin-bottom: 4px; border-radius: 9px; border: 1px solid #e2e8f0;
  background: #fff; cursor: pointer; font-size: 12px;
}
.prodbtn:hover { border-color: #185fa5; background: #e6f1fb; }
.prodbtn small { color: #185fa5; font-weight: 700; }
.modal-card { max-height: 85vh; overflow-y: auto; }

/* bildirim */
.ed-toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200;
  max-width: 640px; padding: 10px 16px; border-radius: 12px; font-size: 13px; font-weight: 700;
  background: #0f172a; color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.ed-toast.error { background: #991b1b; }
.ed-toast.warn { background: #9a3412; }
.ed-toast.hidden { display: none; }

a.project-row { text-decoration: none; color: inherit; }
a.project-row:hover { border-color: #185fa5; }


/* ================================
   v20 BİRLEŞİK EKRAN
   ================================ */

.ed-stats { display: flex; gap: 6px; margin-left: 8px; }
.ed-stats div {
  display: flex; flex-direction: column; align-items: center; min-width: 54px;
  padding: 3px 8px; border-radius: 10px; background: #f1f5f9;
}
.ed-stats b { font-size: 16px; line-height: 1.1; color: #0f172a; }
.ed-stats span { font-size: 10px; color: #64748b; font-weight: 700; }
.ed-zoom { display: flex; align-items: center; gap: 4px; }
.ed-zoom input { width: 90px; }
.ed-zoom .ed-soft { padding: 5px 9px; }

.ed-left {
  width: 260px; flex-shrink: 0; overflow-y: auto; padding: 10px;
  background: #fff; border-right: 1px solid #dbe6f2;
}
.ed-left section { margin-bottom: 14px; }
.ed-left h4 {
  margin: 0 0 6px; font-size: 11px; font-weight: 900; color: #475569;
  text-transform: uppercase; letter-spacing: .06em;
}
.ed-toolgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.ed-toolgrid button {
  text-align: left; padding: 7px 8px; border-radius: 9px; cursor: pointer; font-size: 12px;
  font-weight: 700; border: 1px solid #dbe6f2; background: #f8fafc; color: #26364d;
}
.ed-toolgrid button:hover { border-color: #93c5fd; }
.ed-toolgrid button.active { background: #185fa5; border-color: #185fa5; color: #fff; }
.ed-target { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.ed-target select {
  flex: 1; min-width: 0; padding: 6px 8px; border-radius: 9px; border: 1.5px solid #185fa5;
  font-weight: 800; color: #185fa5; background: #eff6ff;
}
.ed-qty { font-size: 11px; font-weight: 700; color: #64748b; display: flex; align-items: center; gap: 4px; }
.ed-qty input { width: 48px; padding: 5px; border-radius: 8px; border: 1px solid #cbd5e1; }
.ed-list { display: flex; flex-direction: column; gap: 3px; }
.ed-group {
  font-size: 10px; font-weight: 900; color: #94a3b8; text-transform: uppercase;
  margin: 6px 0 1px; letter-spacing: .05em;
}
.ed-item {
  display: flex; align-items: center; gap: 7px; width: 100%; text-align: left;
  padding: 7px 9px; border-radius: 10px; border: 1px solid #e2e8f0; background: #fff;
  cursor: pointer; font-size: 12px; font-weight: 700; color: #1e293b;
}
.ed-item:hover { border-color: #185fa5; background: #eff6ff; }
.ed-item .ic { font-size: 16px; width: 20px; text-align: center; }
.ed-item .nm { flex: 1; }
.ed-item small { font-size: 10px; font-weight: 800; color: #64748b; }
.ed-item small.e { color: #8B4513; }
.ed-item small.k { color: #15803d; }
.ed-health { font-size: 12px; }

.ed-viewbar {
  display: flex; align-items: center; gap: 14px; padding: 5px 10px;
  background: #eef5fc; border-bottom: 1px solid #dbe6f2;
}
.ed-views { display: flex; gap: 4px; }
.ed-views button {
  font-size: 12px; font-weight: 800; padding: 5px 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid #cbd5e1; background: #fff; color: #475569;
}
.ed-views button.active { background: #0f172a; color: #fff; border-color: #0f172a; }
.ed-sizer { position: relative; }
.ed-stage { transform-origin: 0 0; }
.ed-din { padding: 16px; background: #edf3f9; }
.ed-din-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; font-size: 12px; color: #64748b; }
.ed-din-head select { padding: 6px 8px; border-radius: 9px; border: 1px solid #cbd5e1; font-weight: 700; }
#panelCanvas { background: #fff; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.ed-scroller.hidden, .ed-right.hidden { display: none; }

.rbox.selected { box-shadow: 0 0 0 4px rgba(24,95,165,.28); }
.rbox.selected .rhdr { background: #0b3d74; }
.pbox.selected { box-shadow: 0 0 0 4px rgba(95,94,90,.25); }

/* v21: gateway ile kontrol edilen cihazlar (klima, VRF) */
.dchip.ctl { border-color: #7dd3fc; color: #075985; }
.ed-item small.c { color: #0369a1; }
.devlist { max-height: 46vh; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; margin-bottom: 10px; }
.ed-item.on { border-color: #185fa5; background: #e6f1fb; }
.chbtn.used.c-valve, .chbtn.used.c-valve_solenoid, .chbtn.used.c-valve_motor, .chbtn.used.c-valve_prop { background: #fdecec; border-color: #fca5a5; }
.chbtn.used.c-ac_split, .chbtn.used.c-vrf_indoor { background: #e0f2fe; border-color: #7dd3fc; }
.chbtn.used.c-fancoil { background: #fef3c7; border-color: #fcd34d; }
.chgrid { max-width: 330px; }

.lg-ctl { background: repeating-linear-gradient(90deg,#0284c7 0 6px,transparent 6px 10px); }

/* v22: panel dahili röleleri (Akubela) */
.relayrow {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  margin: 0 6px 6px; padding: 4px 6px; border-radius: 8px;
  background: #fff; border: 1px dashed #94a3b8; font-size: 10px; color: #475569; font-weight: 700;
}
.relayrow > span { margin-right: 4px; }
.chbtn.mini { width: 26px; height: 30px; font-size: 10px; }

/* ---------- v26: pano = gerçek DIN ray görünümü ---------- */
.pbox.din { background: #e5e7eb; border: 2px solid #4b5563; border-radius: 6px; min-width: 240px; }
.pbox.din .phdr { background: linear-gradient(#f3f4f6, #e5e7eb); border-bottom: 1px solid #9ca3af; font-weight: 800; }
.pbox.din .rails { padding: 8px 10px 4px; display: flex; flex-direction: column; gap: 14px; }
.pbox.din .rail { position: relative; display: flex; align-items: stretch; gap: 0; padding: 0 4px; }
.pbox.din .rail::before {          /* metal DIN ray */
  content: ""; position: absolute; left: -6px; right: -6px; top: 50%; height: 22px; transform: translateY(-50%);
  background: repeating-linear-gradient(90deg, #9ca3af 0 10px, #b9bec6 10px 14px);
  border-top: 2px solid #6b7280; border-bottom: 2px solid #6b7280; border-radius: 2px; z-index: 0;
}
.pbox.din .mod {
  position: relative; z-index: 1; background: linear-gradient(#ffffff, #f1f5f9);
  border: 1px solid #94a3b8; border-left-width: 0; display: flex; flex-direction: column;
  box-shadow: inset 0 3px 0 var(--mc), 0 1px 2px rgba(0,0,0,.12);
}
.pbox.din .mod:first-child { border-left-width: 1px; border-radius: 3px 0 0 3px; }
.pbox.din .mod:last-child { border-radius: 0 3px 3px 0; }
.pbox.din .mod.nobus { background: linear-gradient(#fffbeb, #fef3c7); }
.pbox.din .screws { display: flex; justify-content: space-evenly; padding: 4px 2px 2px; }
.pbox.din .screws i { width: 7px; height: 7px; border-radius: 50%; background: radial-gradient(#cbd5e1 30%, #64748b 70%); display: block; }
.pbox.din .ptitle {
  background: transparent; font-size: 8.5px; line-height: 1.15; padding: 2px 4px; color: #111827;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; min-height: 30px;
  border-bottom: 1px dashed #cbd5e1;
}
.pbox.din .chgrid { padding: 4px 3px; gap: 2px; justify-items: center; }
.pbox.din .chbtn { width: 22px; height: 26px; border-radius: 4px; font-size: 10px; }
.pbox.din .chbtn span { font-size: 7px; }
.pbox.din .mled { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 20px; }
.pbox.din .mled i { width: 6px; height: 6px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 4px #22c55e; }
.pbox.din .klemens { justify-content: center; padding: 2px 2px; gap: 2px; font-size: 7.5px; margin-top: auto; }
.pbox.din .klemens i { width: 9px; height: 9px; font-size: 8px; line-height: 9px; }
.pbox.din .klemens em { font-size: 7.5px; }
.pbox.din .klemens.dc em { color: #0e7490; }
.pbox.din .klemens.nb em { color: #b45309; }

/* VRF/VRV dış ünite (bina dışı) */
.obox {
  position: absolute; z-index: 2; background: #ecfeff; border: 2px dashed #0891b2; border-radius: 10px;
  box-shadow: 0 2px 8px rgba(8,145,178,.12);
}
.ohdr { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; cursor: move;
  background: #cffafe; border-bottom: 1px solid #a5f3fc; font-weight: 800; color: #155e75; font-size: 12px; border-radius: 8px 8px 0 0; }
.ohdr small { font-size: 9px; letter-spacing: .08em; color: #0e7490; }
.obody { display: flex; gap: 10px; align-items: center; padding: 8px 10px; }
.ofan { display: flex; gap: 4px; }
.ofan i { width: 30px; height: 30px; border-radius: 50%; display: block; border: 3px solid #64748b;
  background: repeating-conic-gradient(#94a3b8 0 20deg, #e2e8f0 20deg 60deg); }
.oinfo { font-size: 10px; color: #334155; line-height: 1.35; }
.odport, .acport { cursor: pointer; font-size: 9px; font-weight: 800; border-radius: 5px; padding: 3px 6px;
  border: 1.5px solid #0284c7; background: #e0f2fe; color: #0369a1; }
.odport { margin: 0 10px 8px; }
.acport.picked, .odport.picked { background: #0284c7; color: #fff; }
.mnote { font-size: 11px; color: #64748b; }

/* sol liste bölüm başlıkları (iş sırası) */
.ed-sec { margin: 12px 0 2px; padding: 6px 8px; border-radius: 6px; background: #185fa5; color: #fff;
  font-size: 11px; font-weight: 800; letter-spacing: .02em; }
.ed-sec:first-child { margin-top: 2px; }
h4 small { font-weight: 600; color: #94a3b8; font-size: 10px; text-transform: none; }

.ed-brands > summary { cursor: pointer; margin: 8px 0 4px; font-size: 10px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: #64748b; }
.ed-brand { margin: 2px 0 2px 6px; }
.ed-brand > summary { cursor: pointer; font-size: 12px; font-weight: 700; color: #185fa5; padding: 3px 0; }
.ed-brand > summary small { color: #94a3b8; font-weight: 600; }

.vana em { display: block; font-style: normal; font-size: 7.5px; font-weight: 700; color: #94a3b8; max-width: 100%; text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vana.assigned em { color: #b91c1c; }

/* v27: SVG cihaz simgeleri */
.dicon { display: block; color: #3f3f46; flex: none; }
.ed-item .ic { display: inline-flex; align-items: center; justify-content: center; width: 28px; }
.dchip .ic { display: flex; justify-content: center; }
.dchip.energy .dicon { color: #3f3f46; }
.dchip.knx .dicon { color: #3f3f46; }
.dchip.ctl .dicon { color: #3f3f46; }
.chbtn .dicon { margin: 0 auto; }

/* v27.2 Akubela görsel dili: simge yumuşak daire zemin üzerinde */
.ed-item .ic { width: 34px; height: 34px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(239,138,58,.18), 0 0 0 1px #fdf0e3; }
.dchip .ic { width: 36px; height: 36px; margin: 0 auto; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(239,138,58,.2), 0 0 0 1px #fdf0e3; align-items: center; }
