/* Console shell (UniFi-style): a 64px icon rail + a closable tab strip, wrapping the
   existing Studio section content. Scoped to `.studio-shell.dfc` so it overrides the old
   topbar/left-nav layout without touching the rest of studio.css. Dark-slate + orange, to
   match the device app. */

.studio-shell.dfc {
  display: flex;
  flex-direction: row;
  height: 100vh;
  overflow: hidden;
  background: #070a0e;
  color: #eaf1f5;
}

/* ---- icon rail ---- */
.dfc-rail {
  width: 76px;
  flex: 0 0 76px;
  background: #070b0f;
  border-right: 1px solid #1c2a33;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 0 12px;
  gap: 4px;
  overflow-y: auto;
  scrollbar-width: none;
  z-index: 3;
}
.dfc-rail::-webkit-scrollbar { display: none; }
.dfc-brand {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  background: linear-gradient(160deg, #ff8a2e, #e7620a);
  color: #0b1116;
  font-family: Consolas, "SF Mono", ui-monospace, monospace;
  font-weight: 700;
  font-size: 20px;
  flex: 0 0 auto;
}
.dfc-navbtn {
  position: relative;
  width: 54px;
  height: 46px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: #5c6a75;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .14s, color .14s;
  flex: 0 0 auto;
}
.dfc-navbtn:hover { color: #8fa0ab; background: #0e161d; }
.dfc-navbtn.on { color: #ff7a1a; background: rgba(255, 122, 26, .13); }
.dfc-navbtn.on::before {
  content: "";
  position: absolute;
  left: -11px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #ff7a1a;
}
.dfc-ico {
  display: grid;
  place-items: center;
}
.dfc-ico svg {
  width: 25px;
  height: 25px;
  display: block;
}
.dfc-rail-spacer { flex: 1 0 8px; }
.dfc-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #1c2a33;
  display: grid;
  place-items: center;
  color: #8fa0ab;
  font-family: Consolas, "SF Mono", ui-monospace, monospace;
  font-size: 13px;
  border: 1px solid #22303a;
  margin-top: 6px;
  flex: 0 0 auto;
}

/* ---- content column (rail's sibling) ---- */
.studio-shell.dfc .studio-frame {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  overflow: hidden;
  background: transparent;
  padding: 0;
  gap: 0;
}

/* ---- tab strip ---- */
.dfc-tabs {
  height: 44px;
  flex: 0 0 44px;
  background: #0b1116;
  border-bottom: 1px solid #1c2a33;
  display: flex;
  align-items: stretch;
}
.dfc-crumb {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-left: 18px;
  flex: 1;
  min-width: 0;
  font-size: 13px;
}
.crumb-area { color: #7c8b96; }
.crumb-sep { color: #3a4750; font-size: 13px; }
.crumb-page { color: #eaf1f5; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dfc-tabstrip {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  padding-left: 10px;
  overflow-x: auto;
  flex: 1;
  scrollbar-width: none;
}
.dfc-tabstrip::-webkit-scrollbar { display: none; }
.dfc-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  margin-top: 7px;
  padding: 0 8px 0 12px;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 7px 7px 0 0;
  color: #8fa0ab;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  font-size: 12.5px;
  transition: background .12s, color .12s;
}
.dfc-tab:hover { color: #eaf1f5; background: #0e161d; }
.dfc-tab.on { color: #eaf1f5; background: #070a0e; border-color: #1c2a33; }
.dfc-x {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  color: #5c6a75;
  font-size: 14px;
  line-height: 1;
}
.dfc-x:hover { background: #22303a; color: #eaf1f5; }
.dfc-tabmeta {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  color: #8fa0ab;
  font-size: 12px;
}
.dfc-org { display: flex; flex-direction: column; line-height: 1.2; text-align: right; }
.dfc-org strong { color: #eaf1f5; font-weight: 600; font-size: 12.5px; }
.dfc-org span { color: #5c6a75; font-size: 11px; }

/* ---- content region: let the existing section pages fill + scroll ---- */
.studio-shell.dfc .studio-main {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

/* ---- Dashboard ---- */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 4px 0 22px;
}
.dash-card {
  text-align: left;
  background: #0b1116;
  border: 1px solid #1c2a33;
  border-radius: 12px;
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: border-color .14s, background .14s, transform .06s;
}
.dash-card:hover { border-color: #33454f; background: #0e161d; }
.dash-card:active { transform: translateY(1px); }
.dash-num {
  font-size: 34px;
  font-weight: 700;
  color: #eaf1f5;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.dash-label { font-size: 11px; letter-spacing: .09em; color: #8fa0ab; }
.dash-sub { font-size: 12px; color: #5c6a75; }
.dash-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.dash-panel {
  background: #0b1116;
  border: 1px solid #1c2a33;
  border-radius: 12px;
  padding: 18px;
}
.dash-panel > .eyebrow { margin-bottom: 14px; }
.dash-clear { color: #6fd08c; font-size: 13px; }
.dash-attention {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-top: 1px solid #141e26;
  padding: 12px 2px;
  color: #cbd6dd;
  font-size: 13px;
  cursor: pointer;
}
.dash-attention:first-of-type { border-top: none; }
.dash-attention:hover { color: #eaf1f5; }
.dash-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f0b429;
  flex: 0 0 auto;
}
.dash-go { margin-left: auto; color: #ff7a1a; }

/* ---- Devices page: summary tiles + fleet table ---- */
.dev-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 4px 0 20px;
}
.dev-stat {
  flex: 1 1 120px;
  min-width: 110px;
  background: #0b1116;
  border: 1px solid #1c2a33;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dev-stat strong {
  font-size: 24px;
  font-weight: 700;
  color: #eaf1f5;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.dev-stat span {
  font-size: 10.5px;
  letter-spacing: .08em;
  color: #5c6a75;
}

.dev-table {
  border: 1px solid #1c2a33;
  border-radius: 10px;
  overflow: hidden;
  background: #0b1116;
}
.dev-row {
  display: grid;
  grid-template-columns: 1.3fr 1.1fr 1.3fr 1.3fr 0.8fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-top: 1px solid #141e26;
  font-size: 13px;
  color: #cbd6dd;
}
.dev-group-select {
  width: 100%;
  max-width: 190px;
  background: #0e161d;
  color: #cbd6dd;
  border: 1px solid #22303a;
  border-radius: 7px;
  padding: 5px 8px;
  font-size: 12.5px;
  cursor: pointer;
}
.dev-group-select:hover { border-color: #33454f; }
.dev-assigned { color: #9fb0bb; }
.dev-unassigned { color: #5c6a75; }
.dev-row:first-child { border-top: none; }
.dev-head {
  font-size: 10.5px;
  letter-spacing: .08em;
  color: #5c6a75;
  background: #091016;
}
.dev-name { color: #eaf1f5; font-weight: 600; }
.dev-serial { font-family: Consolas, "SF Mono", ui-monospace, monospace; color: #9fb0bb; }
.dev-seen { color: #7c8b96; font-variant-numeric: tabular-nums; }
.dev-pill {
  font-style: normal;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .05em;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.dev-pill.registered { color: #6fd08c; background: rgba(111, 208, 140, .1); border-color: rgba(111, 208, 140, .3); }
.dev-pill.imaging { color: #f0b429; background: rgba(240, 180, 41, .1); border-color: rgba(240, 180, 41, .3); }
.dev-pill.active { color: #4aa3ff; background: rgba(74, 163, 255, .1); border-color: rgba(74, 163, 255, .3); }
.dev-pill.retired { color: #8593a0; background: rgba(133, 147, 160, .08); border-color: rgba(133, 147, 160, .25); }
.dev-actions {
  display: flex;
  gap: 12px;
  justify-self: end;
}
.dev-link {
  border: 0;
  background: transparent;
  color: #8fa0ab;
  font-size: 12.5px;
  cursor: pointer;
  padding: 2px 0;
}
.dev-link:hover { color: #ff7a1a; }
.dev-link.danger:hover { color: #ff5b5b; }
.dev-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.dev-form-row label { flex: 1 1 160px; }

/* ---- Application import: grouped form + return-code editor ---- */
.form-section {
  border: 1px solid #1c2a33;
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 14px;
  background: #0b1116;
}
.form-section-title {
  margin: 0 0 12px;
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #5c6a75;
}
/* Two-column editor so the whole form fits the viewport without scrolling. */
.app-editor-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
.app-editor-col { min-width: 0; display: flex; flex-direction: column; }
.app-editor .form-section { margin-bottom: 16px; padding: 14px 16px; }
.app-editor-col .form-section:last-child { margin-bottom: 0; }
.app-editor textarea { min-height: 130px; }
@media (max-width: 900px) {
  .app-editor-cols { grid-template-columns: 1fr; }
}
.upload-bar {
  margin: 8px 0;
  background: rgba(255, 255, 255, .12);
  border-radius: 4px;
  height: 20px;
  position: relative;
  overflow: hidden;
}
.upload-bar-fill { height: 100%; background: #e8a33d; transition: width .15s linear; }
.upload-bar-label { position: absolute; top: 0; left: 8px; line-height: 20px; font-size: 12px; }
.archive-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  font-size: 12.5px;
  color: #9fb0bb;
}
.archive-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  padding: 3px 8px;
  border-radius: 999px;
  color: #4aa3ff;
  background: rgba(74, 163, 255, .1);
  border: 1px solid rgba(74, 163, 255, .3);
  white-space: nowrap;
}
.quickfill-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.quickfill-label { font-size: 12px; color: #7c8b96; }
.rc-editor { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.rc-row { display: flex; align-items: center; gap: 8px; }
.rc-code {
  width: 120px;
  font-family: Consolas, "SF Mono", ui-monospace, monospace;
}
.rc-kind { width: 130px; }
.rc-remove {
  border: 1px solid #26333d;
  background: transparent;
  color: #8593a0;
  border-radius: 6px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  line-height: 1;
}
.rc-remove:hover { color: #ff5b5b; border-color: #ff5b5b; }
.rc-add {
  border: 1px dashed #2a3a45;
  background: transparent;
  color: #8fa0ab;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12.5px;
  cursor: pointer;
}
.rc-add:hover { color: #ff7a1a; border-color: #ff7a1a; }

/* ---- Applications table ---- */
.app-table { border: 1px solid #1c2a33; border-radius: 10px; overflow: hidden; background: #0b1116; }
.app-row {
  display: grid; grid-template-columns: 1.5fr 0.8fr 1.1fr 1.6fr 0.8fr auto;
  align-items: center; gap: 14px; padding: 12px 16px;
  border-top: 1px solid #141e26; font-size: 13px; color: #cbd6dd; cursor: pointer;
}
.app-row:first-child { border-top: none; }
.app-row:not(.app-head):hover { background: #0e151b; }
.app-head { font-size: 10.5px; letter-spacing: .08em; color: #5c6a75; background: #091016; text-transform: uppercase; cursor: default; }
.app-name { color: #eaf1f5; font-weight: 600; }
.app-ver { font-family: Consolas, "SF Mono", ui-monospace, monospace; color: #9fb0bb; font-variant-numeric: tabular-nums; }
.app-pkg { font-family: Consolas, "SF Mono", ui-monospace, monospace; color: #9fb0bb; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-open { justify-self: end; color: #5c6a75; font-size: 12px; }
.app-row:hover .app-open { color: #ff7a1a; }
@media (max-width: 820px) {
  .app-row { grid-template-columns: 1.4fr 1fr 0.8fr auto; }
  .app-row > :nth-child(3), .app-row > :nth-child(4) { display: none; }
}
/* Application groups table (same style, its own columns) */
.app-row.ag { grid-template-columns: 1.6fr 0.7fr 2fr auto; }
.ag-desc { color: #7c8b96; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 820px) {
  .app-row.ag { grid-template-columns: 1.5fr 0.7fr auto; }
  .app-row.ag > :nth-child(3) { display: none; }
  .app-row.ag > :nth-child(4) { display: block; } /* keep the arrow (base rule hides 4th) */
}

/* ---- Autopilot: tenant-connection tables ---- */
.ap-section { margin-bottom: 34px; }
.ap-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.ap-bar h2 { font-size: 16px; margin: 0; color: #eaf1f5; font-weight: 700; }
.ap-row { display: grid; gap: 16px; align-items: center; padding: 15px 18px; border-top: 1px solid #141e26; font-size: 13px; color: #cbd6dd; cursor: pointer; }
.ap-row.enroll { grid-template-columns: 1.8fr 1fr 1.2fr 0.8fr auto; }
.ap-row.dereg { grid-template-columns: 1.8fr 1fr 0.8fr auto; }
.ap-row:first-child { border-top: none; }
.ap-row:not(.ap-head):hover { background: #0e151b; }
.ap-head { font-size: 10.5px; letter-spacing: .08em; color: #5c6a75; background: #091016; text-transform: uppercase; cursor: default; }
.ap-mono { font-family: Consolas, "SF Mono", ui-monospace, monospace; color: #eaf1f5; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-tags { font-family: Consolas, "SF Mono", ui-monospace, monospace; font-size: 12px; color: #9fb0bb; }
.ap-secret-ok { color: #6fd08c; font-family: Consolas, "SF Mono", ui-monospace, monospace; font-size: 11.5px; }
.ap-secret-na { color: #5c6a75; font-family: Consolas, "SF Mono", ui-monospace, monospace; font-size: 11.5px; }
.ap-open { justify-self: end; color: #5c6a75; font-size: 16px; }
.ap-row:hover .ap-open { color: #ff7a1a; }
.ap-empty { border: 1px dashed #1c2a33; border-radius: 10px; background: #091016; padding: 24px 22px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.ap-empty strong { display: block; color: #cbd6dd; font-size: 14px; margin-bottom: 3px; }
.ap-empty small { color: #7c8b96; font-size: 12.5px; }
@media (max-width: 820px) {
  .ap-row.enroll { grid-template-columns: 1.6fr 1fr 0.8fr auto; }
  .ap-row.enroll > :nth-child(3) { display: none; }
}

/* ---- Application import: drawer wizard ---- */
.app-wizard {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(1040px, 96vw);
  background: #0b1116; border-left: 1px solid #1c2a33;
  box-shadow: -24px 0 60px rgba(0,0,0,.5);
  z-index: 41; display: flex; flex-direction: column;
}
.wiz-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 24px 16px; border-bottom: 1px solid #141e26; }
.wiz-head h2 { margin: 2px 0 0; font-size: 20px; color: #eaf1f5; }
.wiz-body { flex: 1; display: grid; grid-template-columns: 224px 1fr; min-height: 0; }
.wiz-rail { border-right: 1px solid #141e26; padding: 16px 12px; background: #091016; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.wiz-step { display: flex; gap: 11px; align-items: flex-start; padding: 9px 10px; border-radius: 8px; cursor: pointer; color: #7c8b96; background: transparent; border: 0; text-align: left; width: 100%; }
.wiz-step:hover { background: #0e151b; }
.wiz-step.active { background: #0e151b; color: #eaf1f5; }
.wiz-num { flex: none; width: 22px; height: 22px; border-radius: 999px; border: 1px solid #26333d; display: grid; place-items: center; font-size: 11px; font-variant-numeric: tabular-nums; color: #5c6a75; background: #0b1116; }
.wiz-step.active .wiz-num { border-color: #ff7a1a; color: #ff7a1a; }
.wiz-step.done .wiz-num { border-color: #6fd08c; color: #04120a; background: #6fd08c; }
.wiz-lbl { font-size: 13px; padding-top: 2px; }
.wiz-lbl small { display: block; color: #5c6a75; font-size: 11px; }
.wiz-step.active .wiz-lbl small { color: #7c8b96; }
.wiz-step.locked { opacity: .4; cursor: not-allowed; }
.wiz-step.locked:hover { background: transparent; }
.wiz-content { padding: 24px 28px; overflow-y: auto; min-height: 0; }
.wiz-content h3 { margin: 0 0 4px; font-size: 17px; color: #eaf1f5; }
.wiz-desc { margin: 0 0 20px; color: #7c8b96; font-size: 13px; max-width: 64ch; }
.wiz-panel { display: none; }
.wiz-panel.on { display: block; }
/* Edit mode = tabbed properties view; each tab fits the drawer (no page scroll). */
.props-body { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 10px 28px 0; }
.props-tabs { display: flex; gap: 2px; border-bottom: 1px solid #141e26; margin-bottom: 18px; flex: none; }
.props-tab { border: 0; background: transparent; color: #7c8b96; padding: 10px 14px; font-size: 13px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.props-tab:hover { color: #cbd6dd; }
.props-tab.on { color: #eaf1f5; border-bottom-color: #ff7a1a; }
.props-pane { display: none; }
.props-pane.on { display: block; flex: 1; min-height: 0; overflow-y: auto; padding-bottom: 8px; }
.props-pane-fill.on { display: block; overflow: hidden; }
.app-wizard label.props-fill-field { margin-bottom: 0; }
.app-wizard label.props-fill-field textarea { height: calc(100vh - 348px); min-height: 200px; resize: none; box-sizing: border-box; }
/* ---- Media page ---- */
.media-card { display: flex; gap: 20px; align-items: flex-start; border: 1px solid #1c2a33; border-radius: 12px; background: #0b1116; padding: 20px 22px; margin-bottom: 16px; }
.media-card.soon { opacity: .75; border-style: dashed; }
.media-ic { flex: none; width: 50px; height: 50px; border-radius: 11px; background: linear-gradient(160deg,#12202b,#0b1116); border: 1px solid #1c2a33; display: grid; place-items: center; font-size: 24px; }
.media-body { flex: 1; min-width: 0; }
.media-name { font-size: 16px; font-weight: 700; color: #eaf1f5; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.media-file { font-family: Consolas, "SF Mono", ui-monospace, monospace; font-size: 12.5px; color: #9fb0bb; font-weight: 400; }
.media-pill { font-family: Consolas, "SF Mono", ui-monospace, monospace; font-size: 10px; letter-spacing: .05em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; }
.media-pill.soon { color: #f0b429; background: rgba(240,180,41,.1); border: 1px solid rgba(240,180,41,.3); }
.media-desc { color: #7c8b96; font-size: 13px; margin: 0; max-width: 64ch; line-height: 1.5; }
.media-meta { display: flex; flex-wrap: wrap; gap: 10px 30px; align-items: flex-start; }
.media-meta > div { min-width: 0; }
.media-meta .k { font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: #5c6a75; margin-bottom: 2px; }
.media-meta .v { font-family: Consolas, "SF Mono", ui-monospace, monospace; font-size: 12.5px; color: #cbd6dd; word-break: break-all; }
.media-actions { flex: none; }
.media-sec { font-size: 13px; font-family: Consolas, "SF Mono", ui-monospace, monospace; letter-spacing: .06em; text-transform: uppercase; color: #7c8b96; margin: 0 0 4px; font-weight: 600; }
.media-admin { border-top: 1px solid #141e26; padding-top: 18px; margin-top: 26px; }
.media-upl { border: 1px dashed #1c2a33; border-radius: 10px; background: #091016; padding: 16px 18px; margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.media-upl label.fld { display: block; margin: 0; }
.media-upl label.fld:last-of-type, .media-upl .upload-bar { grid-column: 1 / -1; }
.media-upl label.fld > span { display: block; font-size: 12px; color: #cbd6dd; margin-bottom: 6px; }
.media-upl input { width: 100%; background: #0b1116; border: 1px solid #1c2a33; color: #eaf1f5; border-radius: 8px; padding: 9px 11px; font-size: 13px; font-family: inherit; }
.media-upl input:focus { outline: none; border-color: #ff7a1a; box-shadow: 0 0 0 3px rgba(255,122,26,.12); }
@media (max-width: 700px) { .media-card { flex-wrap: wrap; } .media-upl { grid-template-columns: 1fr; } }

/* Detection header row + "Detection help" button */
.det-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.det-head h3 { margin: 0; }
.det-templates-label { font-size: 11px; letter-spacing: .04em; color: #7c8b96; }
.help-btn { border: 1px solid #26333d; background: #091016; color: #8fbfe0; border-radius: 7px; padding: 5px 11px; font-size: 12px; cursor: pointer; font-family: inherit; white-space: nowrap; }
.help-btn:hover { border-color: #4aa3ff; color: #cfe6ff; }

/* Help drawer (per-page Help) */
.help-scrim { position: fixed; inset: 0; background: rgba(4,8,11,.55); z-index: 59; }
.help-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 96vw); background: #0b1116;
  border-left: 1px solid #1c2a33; box-shadow: -18px 0 44px rgba(0,0,0,.5); z-index: 60; display: flex; flex-direction: column; }
.help-body { flex: 1; overflow-y: auto; padding: 20px 26px 40px; }
.help-lead { margin: 0 0 16px; color: #cbd6dd; font-size: 13.5px; line-height: 1.5; }
.help-warn { border: 1px solid rgba(240,180,41,.35); background: rgba(240,180,41,.07); border-radius: 9px;
  padding: 12px 14px; font-size: 12.5px; color: #f0d9a0; line-height: 1.5; margin-bottom: 22px; }
.help-warn strong { color: #ffe6ad; }
.help-ex { margin-bottom: 22px; }
.help-ex h4 { margin: 0 0 4px; font-size: 13.5px; color: #eaf1f5; }
.help-ex-note { margin: 0 0 8px; font-size: 12.5px; color: #7c8b96; line-height: 1.45; }
.help-ex pre { margin: 0; background: #060a0e; border: 1px solid #1c2a33; border-radius: 8px; padding: 12px 14px;
  overflow-x: auto; font-family: Consolas, "SF Mono", ui-monospace, monospace; font-size: 12px; color: #cbd6dd;
  line-height: 1.45; white-space: pre; }
.app-wizard label.fld { display: block; margin-bottom: 14px; }
.app-wizard label.fld > span { display: block; font-size: 12.5px; color: #cbd6dd; margin-bottom: 6px; }
.app-wizard input[type=text], .app-wizard input:not([type]), .app-wizard input[type=file], .app-wizard textarea, .app-wizard select {
  width: 100%; background: #091016; border: 1px solid #1c2a33; color: #eaf1f5;
  border-radius: 8px; padding: 9px 11px; font-size: 13px;
}
.app-wizard textarea { font-family: Consolas, "SF Mono", ui-monospace, monospace; font-size: 12.5px; resize: vertical; }
.app-wizard input:focus, .app-wizard textarea:focus, .app-wizard select:focus { outline: none; border-color: #ff7a1a; box-shadow: 0 0 0 3px rgba(255,122,26,.12); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.typecards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tcard { border: 1px solid #1c2a33; background: #091016; border-radius: 10px; padding: 16px; cursor: pointer; text-align: left; color: #cbd6dd; }
.tcard:hover { border-color: #26333d; }
.tcard.sel { border-color: #ff7a1a; box-shadow: 0 0 0 1px #ff7a1a inset; }
.tcard-ic { font-size: 20px; display: block; margin-bottom: 8px; }
.tcard strong { display: block; color: #eaf1f5; font-size: 14px; margin-bottom: 3px; }
.tcard small { color: #7c8b96; font-size: 12px; line-height: 1.4; }
.wiz-callout { border: 1px solid rgba(74,163,255,.3); background: rgba(74,163,255,.06); border-radius: 8px; padding: 12px 14px; font-size: 12.5px; color: #bcd4ec; margin-bottom: 16px; }
.rev { display: grid; grid-template-columns: 160px 1fr; gap: 6px 18px; font-size: 13px; align-items: start; }
.rev .k { color: #7c8b96; }
.rev .v { color: #eaf1f5; word-break: break-word; }
.rev-mono { font-family: Consolas, "SF Mono", ui-monospace, monospace; font-size: 12px; }
.wiz-foot { display: flex; align-items: center; gap: 12px; padding: 16px 24px; border-top: 1px solid #141e26; background: #091016; }
.delete-confirm { font-size: 12.5px; color: #ffb4b4; }
.wiz-spacer { flex: 1; }
.wiz-prog { font-size: 12px; color: #5c6a75; font-family: Consolas, "SF Mono", ui-monospace, monospace; }
@media (max-width: 820px) {
  .wiz-body { grid-template-columns: 1fr; }
  .wiz-rail { flex-direction: row; overflow-x: auto; border-right: none; border-bottom: 1px solid #141e26; }
  .typecards, .two { grid-template-columns: 1fr; }
}

/* ---- Per-device deployment-event drawer ---- */
.dev-drawer-scrim {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 11, .55);
  z-index: 40;
}
.dev-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(460px, 92vw);
  background: #0b1116;
  border-left: 1px solid #1c2a33;
  box-shadow: -18px 0 44px rgba(0, 0, 0, .45);
  z-index: 41;
  display: flex;
  flex-direction: column;
}
.dev-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 12px;
  border-bottom: 1px solid #141e26;
}
.dev-drawer-head h2 { margin: 4px 0 2px; font-size: 18px; color: #eaf1f5; }
.dev-drawer-serial {
  margin: 0;
  font-family: Consolas, "SF Mono", ui-monospace, monospace;
  font-size: 12px;
  color: #7c8b96;
}
.dev-drawer-close {
  border: 0;
  background: transparent;
  color: #7c8b96;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}
.dev-drawer-close:hover { color: #ff7a1a; }
.dev-drawer-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  font-size: 11px;
  letter-spacing: .05em;
  color: #7c8b96;
}
.dev-live {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #465561;
}
.dev-live.on { background: #6fd08c; box-shadow: 0 0 0 3px rgba(111, 208, 140, .18); }
.dev-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 22px 24px;
}
.dev-drawer-empty {
  text-align: center;
  color: #7c8b96;
  padding: 48px 12px;
}
.dev-drawer-empty strong { display: block; color: #cbd6dd; margin-bottom: 6px; }
.dev-drawer-empty p { margin: 0; font-size: 13px; }
.dev-event {
  border-left: 2px solid #2a3a45;
  padding: 8px 0 8px 14px;
  margin-left: 4px;
  position: relative;
}
.dev-event + .dev-event { border-top: 1px solid #10181f; }
.dev-event-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 3px;
}
.dev-event-time {
  font-family: Consolas, "SF Mono", ui-monospace, monospace;
  font-size: 11px;
  color: #7c8b96;
  font-variant-numeric: tabular-nums;
}
.dev-event-stage {
  font-size: 10px;
  letter-spacing: .06em;
  color: #8fa0ab;
}
.dev-event-msg { margin: 0; font-size: 13px; color: #cbd6dd; line-height: 1.4; }
.dev-event-warn { border-left-color: #f0b429; }
.dev-event-warn .dev-event-stage { color: #f0b429; }
.dev-event-error { border-left-color: #ff5b5b; }
.dev-event-error .dev-event-stage { color: #ff7a7a; }
.dev-event-error .dev-event-msg { color: #ffc9c9; }

@media (max-width: 820px) {
  .dev-row { grid-template-columns: 1.3fr 1.2fr 0.8fr auto; }
  /* Hide serial + assigned-sequence on narrow; keep name, group, status, actions. */
  .dev-row > :nth-child(2), .dev-row > :nth-child(4) { display: none; }
  .org-row { grid-template-columns: 1.3fr 0.8fr auto !important; }
  .org-row > :nth-child(2), .org-row > :nth-child(3), .org-row > :nth-child(5) { display: none; }
}

/* ---- Organization members table ---- */
.org-row {
  grid-template-columns: 1.3fr 1.5fr 1.6fr 0.8fr 0.9fr auto;
}
.org-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.org-role-badge {
  font-size: 11px;
  font-weight: 600;
  color: #cbd6dd;
  background: #14202a;
  border: 1px solid #26343e;
  border-radius: 6px;
  padding: 2px 8px;
  white-space: nowrap;
}
.org-role-none { color: #5c6a75; font-style: normal; }
.invite-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 4px 0 18px;
}
.org-role-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 4px 0;
}
.org-check {
  display: flex;
  flex-direction: row !important;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-size: 13px;
  color: #cbd6dd;
}
.org-check input { width: auto; margin: 0; }
.org-invites {
  margin-top: 24px;
  border-top: 1px solid #1c2a33;
  padding-top: 18px;
}
.org-invites > .eyebrow { margin-bottom: 10px; }
.org-invite-row {
  display: grid;
  grid-template-columns: 1.4fr 1.6fr 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 10px 4px;
  border-top: 1px solid #141e26;
  font-size: 13px;
}
.org-invite-row:first-of-type { border-top: none; }

/* ---- Windows Configuration / Join: prompts, rules, conditions ---- */
.rules-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 0 10px; }
.rules-head.mt { margin-top: 26px; }
.rules-head > span { font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: #7c8b96; font-weight: 700; }
.rule-card { border: 1px solid #1c2a33; border-radius: 9px; background: #091016; padding: 12px 13px; margin-bottom: 9px; }
.rule-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.rc-when, .rc-then { font-family: Consolas, "SF Mono", ui-monospace, monospace; font-size: 10px; color: #5c6a75; letter-spacing: .05em; }
.rule-then { display: flex; align-items: center; gap: 9px; margin-top: 10px; }
.cond-list { display: flex; flex-direction: column; gap: 7px; }
.cond-row { display: grid; grid-template-columns: 1.1fr 0.9fr 1fr auto; gap: 7px; align-items: center; }
.cond-any { font-family: Consolas, "SF Mono", ui-monospace, monospace; font-size: 11.5px; color: #5c6a75; }
.cond-add { align-self: flex-start; background: none; border: 1px dashed #1c2a33; color: #9fb0bb; border-radius: 7px; padding: 5px 10px; font-size: 11.5px; cursor: pointer; margin-top: 2px; }
.cond-add:hover { border-color: #ff7a1a; color: #ff7a1a; }
.cond-x { background: none; border: 0; color: #5c6a75; font-size: 15px; cursor: pointer; line-height: 1; padding: 0 4px; }
.cond-x:hover { color: #e8695f; }
/* Phase 5: AND/OR condition groups, predefined-var picks, and prompt visibility. */
.groups { display: flex; flex-direction: column; gap: 8px; }
.cond-group { border: 1px solid #17222b; border-radius: 9px; background: #091016; padding: 10px 11px; }
.cg-head { display: flex; align-items: center; justify-content: space-between; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: #5c6a75; font-weight: 700; margin-bottom: 8px; }
.or-sep { align-self: center; font-size: 10px; letter-spacing: .12em; font-weight: 700; color: #b78cff; margin: 1px 0; }
.or-add { align-self: flex-start; margin-top: 2px; }
.tsvar-picks { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 9px 0 2px; }
.chip-pick { font-family: Consolas, "SF Mono", ui-monospace, monospace; font-size: 11.5px; color: #b78cff; border: 1px solid rgba(183,140,255,.4); background: rgba(183,140,255,.1); border-radius: 6px; padding: 3px 9px; cursor: pointer; }
.chip-pick:hover { background: rgba(183,140,255,.2); }
.prompt-item { border: 1px solid #17222b; border-radius: 9px; background: #0b1116; padding: 10px 11px; margin-bottom: 9px; }
.prompt-item .attach-row { margin-bottom: 8px; }
.pr-visibility { border-top: 1px solid #141e26; padding-top: 9px; }
.grouplbl.sm { font-size: 9.5px; margin-bottom: 8px; }
/* Inline prompt designer */
.rule-drawer.designer { width: min(780px, 96vw); }
.pd-grid { display: grid; grid-template-columns: 1.5fr 1fr 0.8fr auto auto; gap: 8px; align-items: end; }
.pd-f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pd-f > span { font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: #5c6a75; font-weight: 700; }
.pd-f.full { grid-column: 1 / -1; }
.pd-check { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: #cbd6dd; white-space: nowrap; padding-bottom: 8px; }
.import-lib { margin-top: 16px; border-top: 1px solid #141e26; padding-top: 12px; }
.import-lib summary { cursor: pointer; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #8fbfe0; font-weight: 700; }
.import-lib summary:hover { color: #ff7a1a; }
.import-lib .attach-row { margin-top: 8px; }
/* Variables & Rules tab + designer surface */
.editor-tabs { display: flex; gap: 4px; margin: 6px 0 16px; border-bottom: 1px solid #1c2a33; }
.etab { background: none; border: 0; border-bottom: 2px solid transparent; color: #7c8b96; padding: 9px 16px; font-size: 12px; letter-spacing: .06em; font-weight: 700; cursor: pointer; margin-bottom: -1px; }
.etab:hover { color: #eaf1f5; }
.etab.on { color: #ff7a1a; border-bottom-color: #ff7a1a; }
.vr-designer { max-width: 920px; }
.vr-intro { color: #cbd6dd; font-size: 13.5px; max-width: 72ch; margin: 0 0 18px; }
.vr-intro code, .field-hint code { font-family: Consolas, "SF Mono", ui-monospace, monospace; color: #8fbfe0; }
.vr-section { border: 1px solid #1c2a33; border-radius: 12px; background: #0b1116; padding: 16px 18px; margin-bottom: 16px; }
.vr-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.vr-head h3 { margin: 0; font-size: 15px; font-weight: 640; }
.vr-sub { font-size: 12px; color: #5c6a75; }
.vr-outputs { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.vr-out { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.vr-out .k { font-family: Consolas, "SF Mono", ui-monospace, monospace; color: #b78cff; font-size: 12.5px; min-width: 150px; }
.vr-out b { font-family: Consolas, "SF Mono", ui-monospace, monospace; color: #eaf1f5; font-size: 15px; word-break: break-all; font-weight: 600; }
.vr-out b.dn { font-size: 12.5px; color: #cbd6dd; }
.wiz-preview-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 13px; }
.wpn { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1px solid #26333d; display: grid; place-items: center; font-size: 11px; color: #7c8b96; }
.wpl { color: #eaf1f5; }
.grouplbl.sm.mt { margin-top: 16px; }
/* Interactive bench */
.bench-inputs { display: flex; flex-wrap: wrap; gap: 14px 20px; margin-bottom: 16px; }
.bench-f { display: flex; flex-direction: column; gap: 5px; min-width: 170px; }
.bench-f > label { font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: #5c6a75; font-weight: 700; }
.bench-f select.mini, .bench-f input.mini { background: #091016; border: 1px solid #1c2a33; border-radius: 8px; color: #eaf1f5; font-size: 13px; padding: 8px 10px; }
.seg2 { display: inline-flex; border: 1px solid #1c2a33; border-radius: 8px; overflow: hidden; align-self: flex-start; }
.seg-b { background: #0b1116; border: 0; border-right: 1px solid #1c2a33; color: #7c8b96; padding: 8px 16px; font-size: 13px; cursor: pointer; }
.seg-b:last-child { border-right: 0; }
.seg-b.on { background: rgba(255,122,26,.13); color: #eaf1f5; }
.bench-out { border-top: 1px solid #141e26; padding-top: 14px; }
.prompt-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr auto; gap: 7px; align-items: center; }
.prompt-grid2 { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; margin-top: 8px; }
.check-inline { display: flex; align-items: center; gap: 7px; font-size: 12px; color: #cbd6dd; white-space: nowrap; }
.check-inline input { width: auto; }
.rule-card .mini, .rules-head + * .mini { width: 100%; background: #0b1116; border: 1px solid #1c2a33; border-radius: 6px; color: #eaf1f5; font-size: 12px; padding: 7px 9px; }
.rule-card .mini:focus { outline: none; border-color: #ff7a1a; }
.rule-card input.mono, .rule-card .mono, input.mono { font-family: Consolas, "SF Mono", ui-monospace, monospace; }
.rule-card .area { min-height: 58px; resize: vertical; margin-top: 8px; }
.rule-then .grow { flex: 1; }
.field-hint.muted { color: #5c6a75; font-style: italic; }
.rule-preview { display: flex; align-items: baseline; gap: 11px; flex-wrap: wrap; border: 1px solid #16303f; background: #0a141c; border-radius: 8px; padding: 10px 13px; margin-bottom: 12px; }
.rule-preview > span { font-size: 10px; letter-spacing: .08em; color: #7fb2e8; font-weight: 700; }
.rule-preview > b { font-family: Consolas, "SF Mono", ui-monospace, monospace; font-size: 14px; color: #6fd08c; }
.rule-preview > small { color: #5c6a75; font-size: 11px; margin-left: auto; }
.var-palette { border: 1px solid #141e26; border-radius: 9px; background: #091016; padding: 11px 13px; margin-top: 14px; }
.vp-label { font-size: 10px; letter-spacing: .07em; text-transform: uppercase; color: #5c6a75; font-weight: 700; }
.vp-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 9px 0; }
.vp { font-family: Consolas, "SF Mono", ui-monospace, monospace; font-size: 11px; border-radius: 6px; padding: 3px 8px; }
.vp.prompt { border: 1px solid #3a2a18; background: #16110a; color: #ff7a1a; }
.vp.auto { border: 1px solid #16303f; background: #0a1620; color: #7fb2e8; }
.vp-hint { font-size: 11px; color: #5c6a75; font-family: Consolas, "SF Mono", ui-monospace, monospace; }

/* Rule summary rows (compact) that open the editor drawer */
.rule-row { display: flex; align-items: center; gap: 8px; border: 1px solid #1c2a33; border-radius: 9px; background: #091016; padding: 10px 12px; margin-bottom: 8px; }
.rule-row:hover { border-color: #2a3f4d; background: #0e151b; }
.rr-body { flex: 1; min-width: 0; cursor: pointer; }
.rr-when { display: flex; align-items: baseline; gap: 8px; font-size: 12px; color: #cbd6dd; }
.rr-when .rc-when { flex: none; }
.rr-then { display: flex; align-items: baseline; gap: 8px; margin-top: 5px; }
.rr-then code { font-family: Consolas, "SF Mono", ui-monospace, monospace; font-size: 12px; color: #ff9d4d; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Rule editor drawer (popout) */
.rule-drawer-scrim { position: fixed; inset: 0; background: rgba(2,5,8,.6); z-index: 60; }
.rule-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 96vw); background: #0b1116; border-left: 1px solid #1c2a33; box-shadow: -24px 0 60px rgba(0,0,0,.5); z-index: 61; display: flex; flex-direction: column; }
.rd-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 14px; border-bottom: 1px solid #141e26; }
.rd-head h3 { margin: 0; font-size: 17px; color: #eaf1f5; }
.rd-x { background: none; border: 0; color: #7c8b96; font-size: 22px; cursor: pointer; line-height: 1; }
.rd-x:hover { color: #eaf1f5; }
.rd-body { flex: 1; overflow: auto; padding: 20px 22px; }
.rd-body .grouplbl { font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: #5c6a75; font-weight: 700; margin: 0 0 11px; }
.rd-body .grouplbl.mt { margin-top: 24px; }
.rd-foot { display: flex; align-items: center; gap: 10px; padding: 15px 22px; border-top: 1px solid #141e26; }
.rule-drawer .cond-row { grid-template-columns: 1.2fr 1fr 1.2fr auto; }
.rule-drawer .mini, .cond-row input, .cond-row select, .mini.full { width: 100%; background: #091016; border: 1px solid #1c2a33; border-radius: 6px; color: #eaf1f5; font-size: 12.5px; padding: 8px 10px; }
.rule-drawer .mini:focus, .cond-row input:focus, .cond-row select:focus, .mini.full:focus { outline: none; border-color: #ff7a1a; }
.mini.full { margin-bottom: 4px; }
.rule-preview.mt { margin-top: 16px; }
.rule-preview b.small { font-size: 11.5px; }

/* Directory Join config page */
.form-actions { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.form-actions .wiz-spacer { flex: 1; }
.file-btn { position: relative; overflow: hidden; cursor: pointer; }
.file-btn input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.save-notice.standalone { display: block; margin: 4px 0 18px; padding: 9px 13px; border: 1px solid #23404f; border-radius: 8px; background: #0e1a22; color: #d6e6f0; font-size: 12.5px; }

/* ---- accordion primary nav (replaces the flat icon rail) ---- */
.dfc-rail.acc { width: 214px; flex: 0 0 214px; align-items: stretch; padding: 12px 10px 10px; gap: 2px; }
.dfc-rail.acc .dfc-brand-row { display: flex; align-items: center; gap: 11px; padding: 4px 6px 16px; text-decoration: none; }
.dfc-rail.acc .brand-mark { grid-template-columns: repeat(2, 8px); grid-template-rows: repeat(2, 8px); gap: 2px; padding: 7px; box-shadow: inset 0 0 0 3px #10171c; transform: none; flex: none; }
.dfc-rail.acc .brand-copy { line-height: 1; }
.dfc-rail.acc .brand-name { font-size: 0.86rem; font-weight: 800; letter-spacing: .03em; white-space: nowrap; color: #eaf1f5; }
.dfc-rail.acc .brand-tagline { margin-top: 4px; font-size: 0.54rem; color: #79b8dc; }
.dfc-group { display: flex; flex-direction: column; }
.dfc-primary { display: flex; align-items: center; gap: 11px; width: 100%; border: 0; background: transparent; color: #9fb0bb; padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; font-family: inherit; text-align: left; }
.dfc-primary:hover { background: #0e161d; color: #cbd6dd; }
.dfc-primary.cur { color: #eaf1f5; }
.dfc-primary .dfc-ico { color: #7c8b96; }
.dfc-primary.cur .dfc-ico { color: #ff7a1a; }
.dfc-rail.acc .dfc-ico svg { width: 20px; height: 20px; }
.dfc-primary-label { flex: 1; }
.dfc-chev { color: #5c6a75; font-size: 13px; transition: transform .15s; }
.dfc-primary.open .dfc-chev { transform: rotate(90deg); }
.dfc-kids { overflow: hidden; max-height: 0; transition: max-height .18s ease; }
.dfc-kids.open { max-height: 260px; }
.dfc-kid { display: block; width: 100%; border: 0; background: transparent; color: #7c8b96; padding: 7px 10px 7px 42px; border-radius: 7px; cursor: pointer; font-size: 12.5px; text-align: left; font-family: inherit; }
.dfc-kid:hover { background: #0e161d; color: #cbd6dd; }
.dfc-kid.on { color: #eaf1f5; background: rgba(255,122,26,.10); position: relative; }
.dfc-kid.on::before { content: ""; position: absolute; left: 21px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: #ff7a1a; }
.dfc-railfoot { display: flex; padding: 8px 6px 2px; }

/* ---- Prompt Library table ---- */
.prompt-table { border: 1px solid #1c2a33; border-radius: 10px; overflow: hidden; background: #0b1116; margin-top: 4px; }
.prompt-row { display: grid; grid-template-columns: 1.4fr 0.9fr 0.7fr 1.6fr; gap: 14px; align-items: center; padding: 13px 16px; border-top: 1px solid #141e26; font-size: 13px; color: #cbd6dd; cursor: pointer; }
.prompt-row:first-child { border-top: none; }
.prompt-row.head { font-size: 10.5px; letter-spacing: .08em; color: #5c6a75; background: #091016; text-transform: uppercase; cursor: default; }
.prompt-row:not(.head):hover { background: #0e151b; }
.pr-label { color: #eaf1f5; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.pr-req { font-style: normal; font-size: 10px; color: #ff7a1a; border: 1px solid #3a2a18; border-radius: 5px; padding: 1px 6px; }
.pr-key { font-family: Consolas, "SF Mono", ui-monospace, monospace; color: #ff7a1a; font-size: 12px; }
.pr-type { color: #9fb0bb; font-size: 12px; }
.pr-detail { color: #7c8b96; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prompt-empty { padding: 22px 16px; color: #5c6a75; font-size: 12.5px; font-style: italic; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rule-drawer .area { min-height: 70px; resize: vertical; }

/* ---- value-source editor (Static | By-rule) ---- */
.grouplbl { font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: #5c6a75; font-weight: 700; margin: 0 0 10px; }
.grouplbl.mt { margin-top: 22px; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.mode { border: 1px solid #1c2a33; border-radius: 9px; background: #091016; padding: 11px 12px; cursor: pointer; }
.mode:hover { border-color: #2a3f4d; }
.mode.on { border-color: #ff7a1a; background: #16110a; }
.mode .mt { color: #eaf1f5; font-weight: 600; font-size: 12.5px; display: flex; align-items: center; gap: 7px; }
.mode .dot { width: 9px; height: 9px; border-radius: 50%; border: 1px solid #5c6a75; flex: none; }
.mode.on .dot { background: #ff7a1a; border-color: #ff7a1a; }
.mode p { margin: 6px 0 0; font-size: 11px; color: #7c8b96; }

/* ---- sequence prompts drawer ---- */
.attach-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 2px; border-top: 1px solid #141e26; font-size: 12.5px; color: #cbd6dd; }
.attach-row:first-of-type { border-top: none; }
.attach-row .pr-key { font-size: 11.5px; }
.attach-row .pr-type { color: #7c8b96; font-size: 11px; }
.seq-name-aside { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.ax-act { display: flex; gap: 12px; color: #5c6a75; font-size: 13px; }
.ax-act span { cursor: pointer; }
.ax-act span:hover { color: #ff7a1a; }
.ax-n { color: #5c6a75; font-family: Consolas, "SF Mono", ui-monospace, monospace; font-size: 11px; margin-right: 7px; }

/* ---- Task Sequences table + read-only expand ---- */
.ts-table { border: 1px solid #1c2a33; border-radius: 11px; overflow: hidden; background: #0b1116; }
.ts-row { display: grid; grid-template-columns: 26px 1.6fr 1.3fr 0.8fr 0.9fr 0.9fr; gap: 14px; align-items: center; padding: 14px 16px; border-top: 1px solid #141e26; font-size: 13px; color: #cbd6dd; cursor: pointer; }
.ts-row.dg { grid-template-columns: 1.6fr 2fr 0.7fr auto; }
.ts-row.dj { grid-template-columns: 1.5fr 1.4fr 1fr auto; }
.ts-row:first-child { border-top: none; }
.ts-row.head { font-size: 10.5px; letter-spacing: .08em; color: #5c6a75; background: #091016; text-transform: uppercase; cursor: default; }
.ts-row:not(.head):hover { background: #0e151b; }
.ts-row .chev { color: #5c6a75; transition: transform .15s; }
.ts-row.open .chev { transform: rotate(90deg); color: #ff7a1a; }
.ts-name { color: #eaf1f5; font-weight: 600; }
.ts-row .dim { color: #7c8b96; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-pill { font-family: Consolas, "SF Mono", ui-monospace, monospace; font-size: 10.5px; border-radius: 20px; padding: 2px 9px; justify-self: start; }
.ts-pill.published { background: #0f2016; color: #6fd08c; border: 1px solid #204b30; }
.ts-pill.draft { background: #241d0c; color: #e8b54a; border: 1px solid #4a3c18; }
.ts-expand { border-top: 1px solid #141e26; background: #070d12; padding: 16px 18px 18px 56px; }
.ts-exp-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.ts-exp-head > span { font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: #5c6a75; font-weight: 700; }
.ts-exp-actions { display: flex; gap: 8px; }
.ro-step { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid #101a22; font-size: 12.5px; }
.ro-k { width: 26px; height: 26px; border-radius: 7px; background: #16222c; display: flex; align-items: center; justify-content: center; color: #7c8b96; font-size: 9px; font-weight: 700; font-family: Consolas, "SF Mono", ui-monospace, monospace; }
.ro-t b { color: #eaf1f5; font-weight: 600; }
.ro-t small { color: #5c6a75; margin-left: 8px; font-family: Consolas, "SF Mono", ui-monospace, monospace; font-size: 11px; }
.ro-note { font-size: 11.5px; color: #5c6a75; margin-top: 11px; }
.ts-empty { padding: 26px 16px; color: #5c6a75; font-size: 13px; text-align: center; }
.btn { border-radius: 7px; padding: 7px 13px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: "Segoe UI", system-ui, sans-serif; border: 1px solid #23404f; background: #12202a; color: #d6e6f0; }
.btn:hover { border-color: #ff7a1a; color: #ff7a1a; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.danger { border-color: #3a2622; color: #e8695f; background: none; }
.btn.danger:hover { border-color: #e8695f; color: #e8695f; }
.btn.primary { background: #ff7a1a; border-color: #ff7a1a; color: #1a1206; }
.btn.primary:hover { background: #ff8c3a; color: #1a1206; }

/* ---- Deployment wizard ---- */
.wz-scrim { position: fixed; inset: 0; background: rgba(2,5,8,.66); z-index: 50; }
.wz-shell { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); width: min(960px, 94vw); height: min(640px, 90vh); background: #0b1116; border: 1px solid #1c2a33; border-radius: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.6); z-index: 51; display: flex; overflow: hidden; }
.wz-rail { width: 210px; flex: none; background: #080d12; border-right: 1px solid #1c2a33; padding: 18px 0; overflow: auto; }
.wz-brand { display: flex; align-items: center; gap: 9px; padding: 0 18px 16px; color: #eaf1f5; font-weight: 700; font-size: 13.5px; }
.wz-dot { width: 20px; height: 20px; border-radius: 6px; background: #ff7a1a; }
.wz-step { display: flex; align-items: center; gap: 11px; padding: 9px 18px; color: #7c8b96; font-size: 12.5px; cursor: pointer; }
.wz-step:hover { background: #0e161d; }
.wz-step .wz-n { width: 22px; height: 22px; border-radius: 50%; border: 1px solid #1c2a33; display: flex; align-items: center; justify-content: center; font-size: 10.5px; font-family: Consolas, "SF Mono", ui-monospace, monospace; flex: none; }
.wz-step.done .wz-n { background: #12261a; border-color: #2c5138; color: #6fd08c; }
.wz-step.cur { color: #eaf1f5; font-weight: 600; }
.wz-step.cur .wz-n { background: #2a1a0c; border-color: #ff7a1a; color: #ff7a1a; }
.wz-step.skip { opacity: .4; cursor: default; }
.wz-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.wz-page { flex: 1; overflow: auto; padding: 28px 34px; }
.wz-page h3 { font-size: 20px; color: #eaf1f5; margin: 0 0 6px; }
.wz-lead { color: #7c8b96; font-size: 13px; margin: 0 0 22px; max-width: 520px; line-height: 1.5; }
.wz-foot { display: flex; align-items: center; padding: 14px 22px; border-top: 1px solid #141e26; background: #091016; }
.wz-spacer { flex: 1; }
.wz-field { margin-bottom: 18px; max-width: 500px; }
.wz-field > label { display: block; font-size: 12px; color: #9fb0bb; margin-bottom: 7px; font-weight: 600; }
.wz-inp { width: 100%; background: #091016; border: 1px solid #1c2a33; border-radius: 9px; color: #eaf1f5; font-size: 14px; padding: 11px 12px; font-family: "Segoe UI", system-ui, sans-serif; }
.wz-inp.mono { font-family: Consolas, "SF Mono", ui-monospace, monospace; font-size: 13px; }
.wz-inp:focus { outline: none; border-color: #ff7a1a; }
.wz-hint { font-size: 11.5px; color: #5c6a75; margin: 7px 0 0; }
.wz-check { display: flex; align-items: center; gap: 9px; font-size: 13px; color: #cbd6dd; cursor: pointer; }
.wz-check input { width: auto; }
.wz-toggle { display: flex; gap: 10px; }
.wz-toggle button { border: 1px solid #1c2a33; border-radius: 8px; background: #091016; padding: 8px 18px; cursor: pointer; font-size: 12.5px; color: #9fb0bb; font-family: inherit; }
.wz-toggle button.on { border-color: #ff7a1a; background: #16110a; color: #eaf1f5; }
.wz-reveal { margin: 14px 0 0 4px; padding-left: 16px; border-left: 2px solid #23303a; }
.wz-locked { border: 1px solid #1c2a33; background: #091016; border-radius: 9px; padding: 14px 16px; color: #7c8b96; font-size: 13px; }
.wchoice { display: flex; align-items: center; gap: 12px; border: 1px solid #1c2a33; border-radius: 11px; background: #091016; padding: 14px 15px; cursor: pointer; margin-bottom: 10px; max-width: 520px; color: #cbd6dd; font-size: 13.5px; }
.wchoice:hover { border-color: #2a3f4d; }
.wchoice.on { border-color: #ff7a1a; background: #16110a; color: #eaf1f5; }
.wchoice .wrd { width: 17px; height: 17px; border-radius: 50%; border: 2px solid #5c6a75; flex: none; }
.wchoice.on .wrd { border-color: #ff7a1a; background: radial-gradient(circle, #ff7a1a 0 4px, transparent 5px); }
.wz-group { border: 1px solid #1c2a33; border-radius: 10px; background: #091016; padding: 12px 13px; margin-bottom: 10px; max-width: 540px; }
.wz-group-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.wz-app { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; font-size: 12.5px; color: #cbd6dd; }
.wz-app .cond-x { cursor: pointer; color: #5c6a75; }
.wz-app .cond-x:hover { color: #e8695f; }
.wz-summary { max-width: 500px; }
.wz-srow { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-top: 1px solid #141e26; font-size: 13px; color: #7c8b96; }
.wz-srow:first-child { border-top: none; }
.wz-srow b { color: #eaf1f5; font-family: Consolas, "SF Mono", ui-monospace, monospace; font-size: 12.5px; font-weight: 400; }
.lbl-hint { font-style: normal; font-weight: 400; color: #5c6a75; font-size: 11px; margin-left: 8px; }
.key-echo { font-size: 11.5px; color: #7c8b96; margin: -4px 0 12px; }
.key-echo code { font-family: Consolas, "SF Mono", ui-monospace, monospace; color: #ff7a1a; }
.field-warn { font-size: 12px; color: #e8b54a; background: #14110a; border: 1px solid #2a2418; border-radius: 7px; padding: 8px 11px; margin: 4px 0 14px; }
.vp-hint.tip { display: block; margin: 8px 0 0; }

/* wizard close (x) + discard confirm */
.wz-x { position: absolute; top: 10px; right: 12px; z-index: 53; width: 30px; height: 30px; border-radius: 8px; border: 1px solid #1c2a33; background: #0b1116; color: #9fb0bb; cursor: pointer; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.wz-x:hover { border-color: #e8695f; color: #e8695f; }
.wz-confirm { position: absolute; inset: 0; z-index: 52; background: rgba(4,8,11,.72); display: flex; align-items: center; justify-content: center; }
.wz-confirm-card { background: #0e161d; border: 1px solid #23303a; border-radius: 12px; padding: 22px 24px; width: min(380px, 86%); box-shadow: 0 24px 60px rgba(0,0,0,.6); }
.wz-confirm-card h4 { margin: 0 0 8px; font-size: 16px; color: #eaf1f5; }
.wz-confirm-card p { margin: 0 0 18px; font-size: 13px; color: #7c8b96; }
.wz-confirm-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* step editor: vertical ordered step list (replaces the wired canvas) */
.se-list { display: flex; flex-direction: column; gap: 9px; padding: 4px 2px 20px; overflow: auto; min-height: 0; }
.se-empty { border: 1px dashed #23303a; border-radius: 10px; padding: 26px; text-align: center; color: #5c6a75; font-size: 13px; }
.se-row { display: flex; align-items: center; gap: 12px; border: 1px solid #1c2a33; border-radius: 11px; background: #0b1116; padding: 12px 13px; cursor: pointer; }
.se-row:hover { border-color: #2a3f4d; }
.se-row.sel { border-color: #ff7a1a; background: #120d07; }
.se-ord { font-family: Consolas, "SF Mono", ui-monospace, monospace; font-size: 12px; color: #5c6a75; width: 22px; flex: none; text-align: right; }
.se-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.se-body strong { color: #eaf1f5; font-size: 13.5px; font-weight: 600; }
.se-body small { color: #7c8b96; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.se-off { font-size: 10px; letter-spacing: .04em; color: #8a6a2a; border: 1px solid #2a2418; border-radius: 5px; padding: 2px 6px; flex: none; }
.se-actions { display: flex; align-items: center; gap: 5px; flex: none; }
.se-mv { width: 26px; height: 26px; border-radius: 7px; border: 1px solid #1c2a33; background: #091016; color: #9fb0bb; cursor: pointer; font-size: 10px; display: flex; align-items: center; justify-content: center; }
.se-mv:hover:not(:disabled) { border-color: #ff7a1a; color: #eaf1f5; }
.se-mv:disabled { opacity: .3; cursor: default; }
.se-del { width: 26px; height: 26px; border-radius: 7px; border: 1px solid #2a1c1a; background: none; color: #b06a62; cursor: pointer; font-size: 15px; display: flex; align-items: center; justify-content: center; }
.se-del:hover { border-color: #e8695f; color: #e8695f; }

/* ---- Variable Sets designer (Prompt Library) ---- */
.vs-section { margin-top: 42px; padding-top: 30px; border-top: 1px solid #141e26; }
.vs-section .page-heading { margin-bottom: 4px; }
.vs-h2 { font-size: 21px; margin: 2px 0 6px; color: #eaf1f5; }
.vs-section .page-heading code { font-family: Consolas, "SF Mono", ui-monospace, monospace; font-size: 12px; color: #ff9a4d; background: #16110a; border: 1px solid #2a2012; border-radius: 5px; padding: 1px 5px; }
.prompt-row.vs-row { grid-template-columns: 1.1fr 1.3fr 1.9fr; }
.vs-varlist { color: #9fb0bb; font-family: Consolas, "SF Mono", ui-monospace, monospace; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rule-drawer.wide { width: min(760px, 96vw); }

.vs-facts { margin: 6px 0 4px; padding: 12px 14px; border: 1px solid #16232c; border-radius: 10px; background: #091016; }
.vs-fact-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.vs-fact-chips code { font-family: Consolas, "SF Mono", ui-monospace, monospace; font-size: 11.5px; color: #7fd7c4; background: #0b1a17; border: 1px solid #16302a; border-radius: 6px; padding: 3px 8px; }

.vs-card { border: 1px solid #1c2a33; border-radius: 11px; background: #0b1116; padding: 13px 14px; margin-bottom: 12px; }
.vs-card-head { display: flex; align-items: center; gap: 10px; }
.vs-name { flex: 1; min-width: 0; font-weight: 600; }
.modes.sm { display: inline-flex; grid-template-columns: none; gap: 0; margin: 0; border: 1px solid #1c2a33; border-radius: 8px; overflow: hidden; }
.modes.sm .mode { border: 0; border-radius: 0; padding: 7px 13px; font-size: 12px; font-weight: 600; color: #9fb0bb; background: #091016; }
.modes.sm .mode + .mode { border-left: 1px solid #1c2a33; }
.modes.sm .mode.on { background: #16110a; color: #ff9a4d; }

.vs-template { margin-top: 11px; }
.vs-ask { margin-top: 12px; display: flex; flex-direction: column; gap: 11px; }
.vs-ask .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.vs-ask label > span { display: block; font-size: 11.5px; color: #9fb0bb; margin-bottom: 5px; }
.vs-ask .area { min-height: 62px; resize: vertical; }
.vs-ask .field-hint { margin: 0; }
.vs-req { align-self: center; padding-top: 12px; }
.vs-req > span { margin-bottom: 0 !important; font-size: 12.5px; color: #cbd6dd; }
.vs-rules { margin-top: 11px; display: flex; flex-direction: column; gap: 10px; }
.vs-rule { border: 1px solid #16232c; border-radius: 9px; background: #091016; padding: 10px 11px; display: flex; flex-direction: column; gap: 9px; }
.vs-rule-when { display: flex; flex-direction: column; gap: 7px; }
.vs-rule-when .kw, .vs-rule-then .kw { font-size: 10px; letter-spacing: .1em; font-weight: 800; color: #ff7a1a; }
.vs-rule-then { display: flex; align-items: center; gap: 9px; }
.vs-rule-then .full { flex: 1; }
.cond-any { font-size: 12px; color: #7c8b96; font-style: italic; }
.mini.full { width: 100%; }

.vs-preview { margin-top: 20px; padding: 13px 14px; border: 1px solid #16302a; border-radius: 10px; background: #0a1512; }
.vs-out { display: flex; align-items: baseline; gap: 10px; padding: 4px 0; border-top: 1px dashed #13241f; }
.vs-out:first-of-type { border-top: 0; }
.vs-out .k { font-family: Consolas, "SF Mono", ui-monospace, monospace; font-size: 12px; color: #7fd7c4; min-width: 160px; }
.vs-out b { font-family: Consolas, "SF Mono", ui-monospace, monospace; font-size: 13px; color: #eaf1f5; font-weight: 600; }
.field-hint.muted { color: #5c6a75; font-style: italic; }

/* ---- Two-output designer (Computer name / Domain OU + sample-device bench) ---- */
.vs-sim { margin-bottom: 16px; padding: 12px 14px; border: 1px solid #1c2a33; border-radius: 10px; background: #091016; }
.vs-sim-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.vs-sim-row label { font-size: 12px; color: #7c8b96; }
.seg3 { display: inline-flex; border: 1px solid #1c2a33; border-radius: 8px; overflow: hidden; }
.seg3 .seg-b { padding: 6px 13px; font-size: 12.5px; }
.vs-gw { width: 150px !important; }
.vs-out-card { border: 1px solid #1c2a33; border-radius: 11px; background: #0b1116; padding: 14px 15px; margin-bottom: 12px; }
.vs-out-card .out-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 9px; }
.vs-out-card .out-head b { color: #eaf1f5; font-weight: 600; font-size: 14px; }
.vs-outid { font-family: Consolas, "SF Mono", ui-monospace, monospace; font-size: 11.5px; color: #5c6a75; }
.vs-out-res { margin-top: 8px; font-family: Consolas, "SF Mono", ui-monospace, monospace; font-size: 12.5px; color: #7fd7c4; }
.vs-tok { flex: 1; font-family: Consolas, "SF Mono", ui-monospace, monospace; font-size: 14px; color: #ff9a4d; }
.vs-tok-note { font-size: 11px; color: #5c6a75; font-style: italic; }
.pr-key.rand { color: #d6a24a; }
