.dashboard { width: 100%; min-width: 0; min-height: 100svh; padding: 17px 0 34px; align-self: start; }
.dashboard::before { content: "#02"; position: absolute; z-index: -1; right: 5px; top: 96px; color: rgba(0,0,0,.45); font: 70px/1 var(--serif); }
.dashboard::after { content: "↖"; position: fixed; z-index: -1; left: max(230px, calc((100vw - 1120px) / 2 + 180px)); bottom: 12px; color: rgba(0,0,0,.13); font: 110px/1 var(--serif); transform: rotate(-6deg); }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 64px; padding: 11px 15px; background: rgba(232,232,229,.72); }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand b, .brand span { display: block; }
.brand b { font: 400 18px/1 var(--serif); }
.brand span { margin-top: 3px; color: #555; font: 8px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 11px; min-width: 0; }
.status { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid rgba(8,8,8,.22); border-radius: 99px; background: rgba(255,255,255,.48); box-shadow: var(--shadow-control); font-size: 12px; white-space: nowrap; }
.status i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }
.device-id { max-width: 210px; overflow: hidden; color: #555; font: 11px/1 var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.ghost { padding: 8px 12px; border: 1px solid rgba(8,8,8,.28); border-radius: 9px; color: var(--ink); background: rgba(255,255,255,.25); box-shadow: var(--shadow-control); }
.ghost:hover { color: #eee; background: var(--ink); }

.workspace { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 20px; width: 100%; min-width: 0; margin-top: 15px; }
.sidebar { position: sticky; top: 16px; display: flex; flex-direction: column; width: 100%; min-width: 0; height: calc(100svh - 112px); min-height: 420px; padding: 13px; overflow: hidden; background: rgba(226,226,223,.66); }
.search { position: relative; margin: 0 0 16px; }
.search span { position: absolute; left: 12px; top: 10px; color: var(--ink); }
.search input { height: 38px; padding: 0 10px 0 34px; border: 1px solid rgba(0,0,0,.48); font-size: 12px; }
#categories { display: grid; gap: 7px; min-width: 0; }
#categories button { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid transparent; border-radius: 10px; color: #545452; background: transparent; font-size: 14px; font-weight: 600; text-align: left; }
#categories button:hover { color: var(--ink); background: rgba(255,255,255,.38); }
#categories button.active { color: var(--ink); border-color: rgba(8,8,8,.18); background: rgba(248,248,245,.72); box-shadow: 0 6px 15px rgba(0,0,0,.08); }
#categories em { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding-inline: 5px; border-radius: 99px; color: #eee; background: #252525; font: 9px/1 var(--mono); }
.protocol { margin-top: auto; padding: 13px 8px 3px; border-top: 1px solid var(--ink); color: #494947; font: 10px/1 var(--mono); letter-spacing: .06em; }

.content { width: 100%; min-width: 0; padding: 12px 0 60px; }
.content-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 92px; border-bottom: 1px solid var(--line-soft); }
.content-head h2 { margin: 3px 0 0; font: 400 clamp(32px, 4vw, 43px)/1 var(--serif); letter-spacing: -.05em; }
#summary { margin: 0; color: #3f3f3d; font: 11px/1.4 var(--mono); text-align: right; }
.empty { padding: 55px 20px; color: #444; text-align: center; }

.module-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); width: 100%; min-width: 0; margin-top: 20px; gap: 14px; }
.module { position: relative; min-width: 0; overflow: visible; border: 1px solid rgba(8,8,8,.2); border-radius: 15px; background: rgba(235,235,232,.72); box-shadow: 0 10px 26px rgba(0,0,0,.09), 0 2px 6px rgba(0,0,0,.05); transform: translateY(0); transition: transform .3s cubic-bezier(.22,1,.36,1), background-color .3s ease, border-color .3s ease, box-shadow .3s ease; will-change: transform; }
.module:has(.custom-select.open) { z-index: 10; }
.module:nth-child(even) { background: rgba(220,220,217,.72); }
.module:hover { border-color: rgba(8,8,8,.27); background: rgba(245,245,242,.82); box-shadow: 0 16px 36px rgba(0,0,0,.12), 0 3px 9px rgba(0,0,0,.06); transform: translateY(-3px); }
.module-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 78px; padding: 17px 18px; }
.module-title { min-width: 0; }
.module-title b { display: block; overflow: hidden; font: 500 17px/1.1 var(--serif); text-overflow: ellipsis; white-space: nowrap; }
.module-title span { display: block; margin-top: 5px; overflow: hidden; color: #626260; font: 8px/1 var(--mono); letter-spacing: .08em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.settings { padding: 8px 17px 13px; border-top: 1px solid rgba(8,8,8,.14); background: rgba(255,255,255,.19); }
.setting { display: grid; grid-template-columns: minmax(92px, 1fr) minmax(120px, 1.15fr); align-items: center; gap: 15px; min-width: 0; min-height: 58px; border-bottom: 1px solid rgba(8,8,8,.1); }
.setting:last-child { border-bottom: 0; }
.setting-name { margin: 0; color: #292927; font-size: 14px; font-weight: 650; }
.setting input, .setting select, .setting textarea { min-width: 0; height: 40px; padding: 0 12px; font-size: 14px; font-weight: 600; }
.setting textarea { min-height: 58px; padding: 8px; resize: vertical; }
.number-control { display: grid; grid-template-columns: minmax(0, 1fr) 68px; align-items: center; gap: 10px; min-width: 0; }
.number-control input[type="range"] { padding: 0; }
.range-control { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; min-width: 0; }
.color-control { display: flex; align-items: center; gap: 7px; min-width: 0; }
.color-control input[type="color"] { width: 40px; flex: 0 0 40px; padding: 3px; }
.color-control input[type="text"] { flex: 1; }

.custom-select { position: relative; width: 100%; min-width: 0; }
.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  height: 40px;
  padding: 0 13px;
  border: 1px solid rgba(8,8,8,.2);
  border-radius: var(--radius-control);
  color: var(--ink);
  background: rgba(238,238,235,.72);
  box-shadow: var(--shadow-control);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
}
.custom-select-trigger span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.custom-select-trigger i { width: 8px; height: 8px; flex: 0 0 auto; border-right: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); transform: translateY(-2px) rotate(45deg); transition: transform .16s; }
.custom-select.open .custom-select-trigger { border-color: rgba(8,8,8,.52); box-shadow: 0 0 0 3px rgba(0,0,0,.07), var(--shadow-control); }
.custom-select.open .custom-select-trigger i { transform: translateY(2px) rotate(225deg); }
.custom-select-menu {
  position: absolute;
  z-index: 12;
  top: calc(100% + 7px);
  left: 0;
  right: 0;
  display: grid;
  gap: 3px;
  max-height: 210px;
  padding: 7px;
  overflow-y: auto;
  border: 1px solid rgba(8,8,8,.14);
  border-radius: 13px;
  background: rgba(242,242,239,.98);
  box-shadow: 0 18px 42px rgba(0,0,0,.18), 0 4px 12px rgba(0,0,0,.08);
  backdrop-filter: blur(14px);
}
.custom-select-menu button { position: relative; min-height: 38px; padding: 8px 34px 8px 11px; border: 0; border-radius: 9px; color: #3c3c39; background: transparent; font-size: 14px; font-weight: 600; text-align: left; }
.custom-select-menu button:hover { color: #111; background: rgba(0,0,0,.055); }
.custom-select-menu button.selected { color: #111; background: rgba(0,0,0,.09); }
.custom-select-menu button.selected::after { content: ""; position: absolute; right: 13px; top: 50%; width: 7px; height: 7px; border-radius: 50%; background: #171717; transform: translateY(-50%); }
