/* ============================================================
   SmartFabX — hub-detail.css
   Right/unit detail panel, section studio, Detail Set workspace
   Split from hub.css on 2026-08-31.
   ============================================================ */

/* ── Right Detail Panel (Orgadata Properties style) ───────────── */
.detail-panel {
  width: var(--detail-w);
  min-width: 200px;
  max-width: 550px;
  background: #ffffff;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

/* Tools bar (always collapsed — opens popup) */
.props-tools-bar {
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  background: #f3f5f7;
}

.props-tools-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--section-text);
  transition: background var(--transition);
}

.props-tools-toggle:hover,
.props-tools-toggle.is-open {
  background: #e8ecf0;
}

.props-tools-toggle img {
  flex-shrink: 0;
  object-fit: contain;
}

.props-tools-toggle .tree-badge {
  margin-left: auto;
}

.props-tools-chev {
  flex-shrink: 0;
  color: #8899aa;
  transition: transform 0.15s ease;
}

.props-tools-toggle.is-open .props-tools-chev {
  transform: rotate(180deg);
}

.props-tools-popup {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: none;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 72px 28px 24px;
}

.props-tools-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 28, 40, 0.28);
}

.props-tools-popup-card {
  position: relative;
  z-index: 1;
  width: min(320px, calc(100vw - 40px));
  max-height: min(70vh, 520px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #d5dbe3;
  border-radius: 10px;
  box-shadow: 0 18px 48px rgba(15, 30, 50, 0.22);
  overflow: hidden;
  margin-right: max(8px, calc(var(--detail-w, 280px) - 300px));
}

.props-tools-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #e6ebf0;
  background: #f7f9fb;
}

.props-tools-popup-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #2a3a4a;
}

.props-tools-popup-close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #6a7a8a;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.props-tools-popup-close:hover {
  background: #e8edf2;
  color: #2a3a4a;
}

.props-tools-popup-list {
  overflow-y: auto;
  padding: 8px;
}

.props-tools-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: #2c3a48;
  transition: background 0.12s ease;
}

.props-tools-item:hover {
  background: #eef3f8;
}

.props-tools-item img,
.props-tools-item svg {
  flex-shrink: 0;
}

.props-tools-item.is-planned {
  opacity: 0.55;
  font-style: italic;
}

.detail-panel.is-collapsed {
  width: 34px !important;
  min-width: 34px;
  border-left: 1px solid var(--border);
}

.detail-panel.is-collapsed .detail-panel-title,
.detail-panel.is-collapsed .detail-body,
.detail-panel.is-collapsed .splitter-v,
.detail-panel.is-collapsed .trash-bin {
  display: none !important;
}

.detail-panel.is-collapsed .props-tools-bar span,
.detail-panel.is-collapsed .props-tools-bar .tree-badge,
.detail-panel.is-collapsed .props-tools-chev {
  display: none;
}

.detail-panel.is-collapsed .props-tools-toggle {
  justify-content: center;
  padding: 10px 4px;
}

.detail-panel.is-collapsed .detail-panel-header {
  justify-content: center;
  padding: 8px 4px;
}

.detail-panel.is-collapsed .detail-panel-toggle {
  transform: rotate(180deg);
}

.detail-body {
  flex: 1;
  overflow-y: auto;
}

.detail-body::-webkit-scrollbar { width: 5px; }
.detail-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }

.detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  height: 260px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 24px;
}


/* ── Unit Detail / Elevation Preview in Properties ─── */
.udp-section { padding: 10px 12px; border-bottom: 1px solid #e8e8e8; }
.udp-elev-section { padding: 8px 10px 10px; background: #f8f9fb; }
.udp-elev-header {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.udp-elev-header::before {
  content: '';
  display: inline-block;
  width: 3px; height: 10px;
  background: var(--accent);
  border-radius: 2px;
}
.udp-elevation {
  width: 100%;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  overflow: hidden;
}
.udp-elevation svg {
  width: 100%;
  max-width: 100%;
  max-height: 360px;
  height: auto;
  display: block;
}
/* Card and properties show the elevation's own frame, glass, and dimensions. */
.udp-elevation-empty {
  flex-direction: column;
  gap: 6px;
  min-height: 140px;
  color: var(--text-muted);
  font-size: 12px;
}
.udp-hint {
  font-size: 10px;
  color: #b0b0b0;
}
.udp-info { padding: 8px 12px; }
.udp-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--sky-100);
  font-size: 12px;
}
.udp-row:last-child { border-bottom: none; }
.udp-label { color: var(--text-muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.3px; }
.udp-value { color: var(--text-primary); font-weight: 500; text-align: right; }
.udp-unit-name { font-weight: 700; color: var(--accent); font-size: 13px; }
.udp-mono { font-family: var(--font-mono); font-size: 12px; }
.udp-status {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.udp-status.configured { background: #d4edda; color: #155724; }
.udp-status.new { background: #e2e3e5; color: #383d41; }
.udp-actions { padding: 10px 12px; }
.udp-load-btn {
  width: 100%;
  padding: 10px 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.2px;
  box-shadow: 0 2px 6px rgba(37,99,235,0.2);
}
.udp-load-btn:hover { background: var(--accent-hover); box-shadow: 0 4px 12px rgba(37,99,235,0.3); transform: translateY(-1px); }

/* ── "Add to Project" button in detail panel ─────── */
.dp-project-wrap {
  padding: 6px 12px;
  border-bottom: 1px solid #e0e0e0;
}

.dp-project-select {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--text-primary);
  background: #fff;
  cursor: pointer;
}
.dp-project-select:focus { outline: none; border-color: var(--accent); }

/* ══ PROJECT SECTION STUDIO ═══════════════════════════════════ */
#projectSectionStudio {
  padding: 12px;
  align-items: stretch;
  justify-content: center;
}
.pss-container {
  width: min(1280px, calc(100vw - 24px));
  height: min(94vh, calc(100vh - 24px));
  display: flex;
  flex-direction: column;
  background: #f4f6f8;
  border-radius: 6px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.12),
    0 16px 40px rgba(15, 23, 42, 0.16);
}
.pss-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: #0f172a;
  color: #fff;
  flex: 0 0 auto;
}
.pss-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.pss-header-sep { opacity: 0.45; }
.pss-header-name { font-weight: 600; letter-spacing: 0; opacity: 0.9; }
.pss-header-actions { display: flex; align-items: center; gap: 8px; }
.pss-unit-select {
  min-width: 140px;
  max-width: 220px;
  height: 32px;
  border: 1px solid #334155;
  background: #1e293b;
  color: #fff;
  border-radius: 4px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
}
.pss-btn {
  height: 32px;
  padding: 0 12px;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  background: #e2e8f0;
  color: #0f172a;
}
.pss-btn--primary { background: #2563eb; color: #fff; }
.pss-btn--close { background: #334155; color: #fff; }
.pss-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #fff;
  border-bottom: 1px solid #cbd5e1;
  flex: 0 0 auto;
}
.pss-tool {
  height: 30px;
  padding: 0 12px;
  border: 1px solid #94a3b8;
  background: #f8fafc;
  color: #0f172a;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.pss-tool.is-active {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}
.pss-tool[data-tool="delete"].is-active {
  background: #b91c1c;
  border-color: #b91c1c;
}
.pss-tool-hint { font-size: 12px; color: #475569; margin-left: 6px; }
.pss-body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 10px;
  padding: 10px;
}
.pss-pane {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #94a3b8;
}
.pss-pane-head {
  flex: 0 0 auto;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid #cbd5e1;
  background: #f1f5f9;
  color: #0f172a;
}
.pss-elev-stage,
.pss-preview-stage {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  background:
    linear-gradient(90deg, rgba(148,163,184,0.07) 1px, transparent 1px) 0 0 / 20px 20px,
    linear-gradient(rgba(148,163,184,0.07) 1px, transparent 1px) 0 0 / 20px 20px,
    #fff;
}
.pss-elev-svg,
.pss-preview-svg {
  position: absolute;
  inset: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pss-preview-svg {
  align-items: stretch;
  justify-content: flex-start;
  overflow-x: auto;
  overflow-y: hidden;
}
.pss-elev-svg svg,
.pss-preview-svg svg {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
}
.pss-preview-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 12px;
  width: 100%;
  height: 100%;
  min-width: 0;
}
.pss-preview-tile {
  flex: 1 1 0;
  min-width: 150px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border: 1px solid #cbd5e1;
  background: #fff;
  cursor: pointer;
  padding: 6px 8px 8px;
  text-align: center;
  font: inherit;
  color: inherit;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
}
.pss-preview-tile.is-active {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.22);
}
.pss-preview-tile-label {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #1d4ed8;
  margin-bottom: 6px;
}
.pss-preview-tile-svg {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pss-preview-tile-svg svg {
  max-width: 100%;
  max-height: 100%;
}
.pss-mark-overlay {
  position: absolute;
  left: 8px;
  top: 8px;
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  pointer-events: none;
  overflow: visible;
}
.pss-elev-stage { cursor: crosshair; }
.pss-preview-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
}
.pss-footer {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 14px 10px;
  background: #fff;
  border-top: 1px solid #cbd5e1;
}
.pss-marks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 22px;
}
.pss-mark-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border: 1px solid #94a3b8;
  background: #f8fafc;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.pss-mark-chip.is-active { border-color: #1d4ed8; color: #1d4ed8; background: #eff6ff; }
.pss-mark-chip--plan { border-color: #b45309; }
.pss-mark-chip--vertical { border-color: #1d4ed8; }
.pss-footer-note { font-size: 11px; color: #64748b; }
@media (max-width: 900px) {
  .pss-body { grid-template-columns: 1fr; }
}

/* ── Detail Set — professional two-column workspace ─────────── */
.dtl-ws {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(380px, 0.98fr);
  gap: 14px;
  padding: 14px;
  align-items: start;
}
@media (max-width: 1180px) {
  .dtl-ws { grid-template-columns: 1fr; }
}
.dtl-ws-main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.dtl-ws-side { min-width: 0; min-height: 0; }
.dtl-ws-side-inner {
  position: sticky;
  top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: calc(100dvh - 168px);
  max-height: calc(100dvh - 168px);
  overflow: hidden;
}
@media (max-width: 1180px) {
  .dtl-ws-side-inner { position: static; height: auto; max-height: none; }
  .dtl-preview-host { height: 260px; min-height: 260px; max-height: 260px; }
}
.dtl-ws .az-form-grid { padding: 0; }
.dtl-family-banner {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  font-size: 11px;
  line-height: 1.45;
  color: #475569;
}
.dtl-family-banner b { font-size: 12px; color: #0f172a; }
.dtl-family-banner--sliding {
  border-color: #99f6e4;
  background: #f0fdfa;
}
.dtl-family-banner--sliding b { color: #0f766e; }
.dtl-family-banner--casement {
  border-color: #bfdbfe;
  background: #eff6ff;
}
.dtl-family-banner--casement b { color: #1d4ed8; }
.dtl-cover-hint {
  grid-column: 1 / -1;
  margin-top: -4px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #ddd6fe;
  background: #f5f3ff;
  font-size: 11px;
  line-height: 1.45;
  color: #5b21b6;
}
.dtl-cover-hint b { color: #4c1d95; }
.dtl-conn-panel {
  grid-column: 1 / -1;
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
}
.dtl-conn-panel--sliding {
  border-color: #99f6e4;
  background: #f0fdfa;
}
.dtl-conn-panel--sliding.is-active {
  border-color: #5eead4;
  background: #ccfbf1;
}
.dtl-conn-panel--frame {
  border-color: #e2e8f0;
  background: #f8fafc;
}
.dtl-conn-title {
  font-size: 12px;
  font-weight: 700;
  color: #0f766e;
  margin-bottom: 6px;
}
.dtl-conn-panel--elev {
  border-color: #cbd5e1;
  background: #f8fafc;
}
.dtl-conn-panel--elev .dtl-conn-title { color: #0f172a; }
.dtl-conn-lead {
  margin: 0 0 10px;
  font-size: 11px;
  color: #64748b;
  line-height: 1.45;
}
.dtl-conn-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.dtl-conn-extras {
  margin-top: 8px;
  font-size: 11px;
  color: #64748b;
  line-height: 1.45;
}

.dtl-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}
.dtl-panel__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11px;
  font-weight: 800;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
}
.dtl-panel__title .dtl-panel__tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  text-transform: none;
  letter-spacing: 0;
}
.dtl-panel__title .dtl-panel__hint {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
}
.az-dtl-glass-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.az-dtl-glass-row {
  display: grid;
  grid-template-columns: 28px minmax(180px, 1.2fr) minmax(160px, 1fr) minmax(90px, 0.5fr) auto;
  gap: 8px;
  align-items: end;
}
.az-dtl-glass-row__idx {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  padding-bottom: 8px;
  text-align: center;
}
.az-dtl-acc-kind {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.az-dtl-acc-kind--gasket { color: #059669; }
.az-dtl-acc-kind--brush { color: #d97706; }
.az-dtl-acc-kind--hardware { color: #4f46e5; }
.az-dtl-acc-kind--accessory { color: #475569; }
.dtl-preview-panel {
  padding: 0;
  overflow: hidden;
  flex: 0 0 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.dtl-preview-panel .dtl-panel__title {
  padding: 8px 12px;
  margin: 0;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  flex: 0 0 auto;
}
.dtl-preview-panel .dtl-panel__title > span:first-child {
  text-align: left;
  min-width: 0;
}
#azDtlPreviewPoseHint {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #ecfeff;
  color: #0f766e;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.dtl-preview-panel .dtl-preview-body {
  padding: 8px 12px 10px;
  flex: 0 0 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.dtl-preview-body--3d { padding-top: 8px; }
.dtl-preview-host {
  flex: 0 0 auto;
  height: 280px;
  min-height: 280px;
  max-height: 280px;
  position: relative;
  cursor: pointer;
}
.dtl-preview-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  min-height: 0;
  display: block;
  background: #fff;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
}
.dtl-preview-hint {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 6px;
  z-index: 1;
  margin: 0;
  padding: 3px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,.88);
  font-size: 10px;
  color: #64748b;
  line-height: 1.4;
  pointer-events: none;
}
.dtl-preview-body > .dtl-cnc-sync {
  flex: 0 0 auto;
}
.dtl-view-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  flex: 0 0 auto;
}
.dtl-view-btn {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 4px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #fff;
  color: #334155;
  cursor: pointer;
  line-height: 1.2;
}
.dtl-view-btn:hover { background: #f1f5f9; border-color: #94a3b8; }
.dtl-view-btn.is-active {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
}
.dtl-view-btn--extra { display: none; }
.dtl-adv-col { display: none; }
.dtl-ws.show-dtl-advanced .dtl-adv-col,
.dtl-ws.show-dtl-advanced .dtl-view-btn--extra { display: table-cell; }
.dtl-ws.show-dtl-advanced .dtl-view-btn--extra { display: inline-flex; }
.dtl-advanced {
  margin: 0;
  padding: 8px 0 0;
}
.dtl-advanced > summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  list-style: none;
  text-align: left;
}
.dtl-advanced > summary::-webkit-details-marker { display: none; }
.dtl-advanced > summary::before {
  content: "▸";
  color: #64748b;
  display: inline-block;
  width: 14px;
  margin-right: 6px;
  text-align: center;
  flex: 0 0 14px;
}
.dtl-advanced[open] > summary::before { content: "▾"; }

/* Collapsed sections 3–5: keep titles left-aligned like 1 · Detail Properties */
.dtl-ws-main > details.dtl-panel.dtl-advanced {
  padding: 0;
  overflow: hidden;
}
.dtl-ws-main > details.dtl-panel.dtl-advanced > summary.dtl-panel__title {
  justify-content: flex-start;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  margin: 0;
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  text-align: left;
  user-select: none;
}
.dtl-ws-main > details.dtl-panel.dtl-advanced > summary.dtl-panel__title > span {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  line-height: 1.35;
}
.dtl-ws-main > details.dtl-panel.dtl-advanced:not([open]) > summary.dtl-panel__title {
  border-bottom: 0;
}
.dtl-ws-main > details.dtl-panel.dtl-advanced > .dtl-panel__tools {
  margin: 0;
  padding: 8px 14px 0;
  justify-content: flex-start;
}
.dtl-ws-main > details.dtl-panel.dtl-advanced > .az-table-wrap,
.dtl-ws-main > details.dtl-panel.dtl-advanced > .az-dtl-glass-rows {
  padding: 8px 14px 12px;
}
.dtl-ws-main > details.dtl-panel.dtl-advanced > summary.dtl-panel__title:hover {
  background: #f8fafc;
}
.dtl-join-hint {
  margin-top: 6px;
  font-size: 11px;
  color: #0369a1;
  line-height: 1.4;
}
.dtl-relation-chip {
  display: inline-block;
  margin-top: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px;
  color: #0f172a;
}
.dtl-more-actions {
  display: inline-block;
}
.dtl-more-actions > summary {
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
}
.dtl-more-actions[open] {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.dtl-family-banner span { display: none; }
.dtl-family-banner b { display: block; }
.dtl-3d-host {
  position: relative;
  width: 100%;
  height: 280px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  background: #0f172a;
  overflow: hidden;
}
.dtl-3d-host canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
.dtl-3d-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
  font-size: 11px;
  color: #94a3b8;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.55);
}
.dtl-cnc-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 120px;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
  padding: 6px;
}
.dtl-cnc-empty {
  font-size: 10px;
  color: #64748b;
  line-height: 1.4;
  padding: 4px 2px;
}
.dtl-cnc-row {
  padding: 5px 6px;
  border-radius: 4px;
  background: #fff;
  border: 1px solid #e2e8f0;
}
.dtl-cnc-row__code {
  font-size: 11px;
  font-weight: 700;
  color: #0f172a;
}
.dtl-cnc-row__meta {
  font-size: 10px;
  color: #64748b;
  margin-top: 1px;
}

/* Detail Set organization tree (Brand → Series → Type → Panels → Slot) */
.dtl-org-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
@media (max-width: 960px) {
  .dtl-org-layout { grid-template-columns: 1fr; }
}
.dtl-org-nav {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  padding: 10px;
  position: sticky;
  top: 8px;
}
.dtl-org-nav__head {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 8px;
}
.dtl-org-tree {
  max-height: 520px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.35;
}
.dtl-org-node {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  color: #0f172a;
  font: inherit;
}
.dtl-org-node:hover { background: #e2e8f0; }
.dtl-org-node.is-active {
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 700;
  box-shadow: inset 3px 0 0 #0284c7;
}
.dtl-org-node__label { display: inline; }
.dtl-org-node__count {
  float: right;
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  background: #e2e8f0;
  border-radius: 999px;
  padding: 1px 6px;
  margin-left: 6px;
}
.dtl-org-node.is-active .dtl-org-node__count {
  background: #bae6fd;
  color: #0369a1;
}
.dtl-org-children { margin-left: 12px; border-left: 1px solid #cbd5e1; padding-left: 4px; }
.dtl-org-path {
  font-size: 12px;
  color: #334155;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
  line-height: 1.45;
}
.dtl-org-path b { color: #0f172a; }
.dtl-org-main { min-width: 0; }

/* Detail Library — right-rail browser + inline editors */
.dtl-lib-panel {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 180px;
  max-height: none;
  flex: 1 1 auto;
}
.dtl-lib-panel .dtl-panel__title {
  padding: 10px 12px;
  margin: 0;
  background: #0f172a;
  color: #f8fafc;
  border-bottom: 1px solid #1e293b;
}
.dtl-lib-panel .dtl-panel__title .dtl-panel__tools { text-transform: none; }
.dtl-lib-scope-hint {
  font-size: 10px;
  font-weight: 600;
  color: #93c5fd;
  margin-left: 4px;
  text-transform: none;
  letter-spacing: 0;
}
.dtl-lib-kit-badge {
  font-size: 9px;
  font-weight: 800;
  color: #166534;
  background: #dcfce7;
  border: 1px solid #86efac;
  border-radius: 999px;
  padding: 1px 6px;
  white-space: nowrap;
}
.dtl-lib-kit-badge.is-warn {
  color: #991b1b;
  background: #fef2f2;
  border-color: #fca5a5;
}
.dtl-lib-card.is-wrong-type {
  border-color: #fca5a5;
  background: #fff7f7;
}
.dtl-lib-card.is-in-kit {
  border-color: #86efac;
}
.dtl-lib-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  margin-left: 8px;
  padding: 0 6px;
  border-radius: 999px;
  background: #1d4ed8;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  vertical-align: middle;
}
.dtl-lib-body {
  display: grid;
  grid-template-columns: minmax(148px, 176px) minmax(0, 1fr);
  gap: 0;
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
}
@media (max-width: 1180px) {
  .dtl-lib-body { grid-template-columns: 1fr; min-height: 420px; }
}
.dtl-lib-nav {
  border-right: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: 10px 8px 10px 10px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
@media (max-width: 1180px) {
  .dtl-lib-nav { border-right: none; border-bottom: 1px solid #e2e8f0; }
}
.dtl-lib-nav .dtl-org-tree {
  flex: 1;
  max-height: none;
  min-height: 0;
  overflow: auto;
}
.dtl-lib-nav .dtl-org-node { padding: 4px 6px; font-size: 11px; }
.dtl-lib-nav .dtl-org-children { margin-left: 8px; }
.dtl-lib-nav #azDtlOrgClear {
  margin-top: 8px;
  font-size: 11px;
  padding: 4px 8px;
  width: 100%;
}
.dtl-lib-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 10px;
  min-height: 0;
}
.dtl-lib-main .dtl-org-path {
  font-size: 11px;
  padding: 6px 8px;
  margin-bottom: 8px;
}
.dtl-lib-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 6px;
  margin-bottom: 8px;
}
.dtl-lib-filters .az-input {
  height: 28px;
  font-size: 12px;
}
.dtl-lib-cards {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 140px;
  padding-right: 2px;
}
.dtl-lib-empty {
  text-align: center;
  color: #64748b;
  padding: 22px 12px;
  font-size: 12px;
  line-height: 1.5;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
}
.dtl-lib-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  padding: 9px 10px 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.12s, box-shadow 0.12s, background 0.12s;
}
.dtl-lib-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.08);
}
.dtl-lib-card.is-current {
  border-color: #2563eb;
  background: #f8fbff;
  box-shadow: inset 3px 0 0 #2563eb, 0 6px 16px rgba(37, 99, 235, 0.1);
}
.dtl-lib-card.is-saved {
  border-color: #16a34a;
  background: #f0fdf4;
}
.dtl-lib-card.has-warn { border-color: #f59e0b; }
.dtl-lib-card__top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.dtl-lib-badges {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding-bottom: 2px;
}
.dtl-lib-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.dtl-lib-field > span {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
}
.dtl-lib-field--code { max-width: 46%; }
.dtl-lib-card .dtl-lib-input {
  height: 26px;
  font-size: 12px;
  padding: 0 7px;
  background: #fff;
}
.dtl-lib-card.is-current .dtl-lib-input { background: #fff; }
.dtl-lib-card__meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin-top: 6px;
}
.dtl-lib-stats {
  font-size: 10px;
  color: #64748b;
  line-height: 1.35;
  padding-bottom: 4px;
  text-align: right;
  max-width: 46%;
}
.dtl-lib-hint {
  font-size: 10px;
  color: #1d4ed8;
  margin-top: 4px;
  line-height: 1.35;
}
.dtl-lib-hint--conn { color: #0f766e; }
.dtl-lib-hint--group { color: #7c3aed; }
.dtl-lib-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid #f1f5f9;
}
.dtl-lib-card__actions .az-btn {
  font-size: 11px;
  padding: 3px 8px;
}
.dtl-lib-card__actions .dtl-lib-remove { color: #b91c1c; }

.az-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: filter 0.1s, transform 0.1s;
}
.az-btn:active { transform: translateY(1px); }
.az-btn--save { background: var(--accent); color: #fff; }
.az-btn--save:hover { filter: brightness(1.07); }
.az-btn--clear { background: #f1f5f9; color: var(--text-muted); border: 1px solid var(--border); }
.az-btn--clear:hover { background: #e2e8f0; }

/* Tables */
.az-table-wrap { overflow-x: auto; }
.az-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
#azDtlMembersTable {
  min-width: 1360px;
}
#azDtlMembersTable .az-dtl-col-profile {
  min-width: 220px;
  width: 240px;
}
#azDtlMembersTable .az-dtl-col-profile .sfx-ss,
#azDtlMembersTable .az-dtl-col-profile .sfx-ss-input,
#azDtlMembersTable .az-dtl-profile {
  min-width: 220px;
  width: 100%;
  box-sizing: border-box;
}
#azDtlMembersTable .az-dtl-col-profile .sfx-ss-input {
  font-family: var(--font-mono, ui-monospace, Consolas, monospace);
  font-size: 12px;
  overflow: visible;
  text-overflow: clip;
}
.az-table thead th {
  background: #f1f5f9;
  border-bottom: 2px solid var(--border-dark);
  padding: 7px 10px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.az-table tbody tr { border-bottom: 1px solid var(--border); }
.az-table tbody tr:hover { background: #f8faff; }
.az-table tbody td { padding: 7px 10px; color: var(--text-primary); vertical-align: middle; }
.az-empty-row { text-align: center; color: var(--text-muted); padding: 18px !important; font-style: italic; }
.az-cell-bold  { font-weight: 700; }
.az-cell-center { text-align: center; }
.az-cell-mono  { font-family: var(--font-mono); font-size: 11px; }
.az-cell-file  { color: var(--text-muted); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Brand pill */
.az-brand-pill {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 10.5px;
  font-weight: 700;
  background: #dbeafe;
  color: #1e40af;
}

/* Status chip */
.az-status-chip { display: inline-block; padding: 2px 7px; border-radius: 3px; font-size: 10px; font-weight: 700; text-transform: capitalize; }
.az-status-chip.ready   { background: var(--ok-bg);   color: #065f46; }
.az-status-chip.inbuild { background: #fef3c7;         color: #92400e; }
.az-status-chip.planned { background: #f1f5f9;         color: var(--text-muted); }

/* Delete button in tables */
.az-del-btn {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #94a3b8;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.az-del-btn:hover { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }

/* Edit / Duplicate row action buttons */
.az-edit-btn, .az-copy-btn {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #94a3b8;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.az-copy-btn {
  width: auto;
  min-width: 54px;
  height: 24px;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 600;
}
.az-edit-btn:hover { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; }
.az-copy-btn:hover { background: #f0fdf4; color: #059669; border-color: #a7f3d0; }
.az-cell-actions { white-space: nowrap; }

/* Editing row highlight */
#azCustomSysTable tr[data-editing="true"] { background: #eff6ff; }

/* Custom System Registry — compact bordered table (not card-like rows) */
.az-sys-reg-wrap {
  overflow: auto;
  max-height: min(56vh, 560px);
  border-top: 1px solid var(--border);
}
.az-sys-reg-table {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
  border-spacing: 0;
  table-layout: auto;
  font-size: 12px;
  line-height: 1.25;
  background: #fff;
  overflow: visible;
  border: none;
  border-radius: 0;
}
.az-sys-reg-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #eef2f6;
  border: 1px solid #d5dde6;
  padding: 5px 8px;
  height: 28px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.az-sys-reg-table tbody td {
  border: 1px solid #e6ebf1;
  padding: 3px 8px;
  height: 30px;
  line-height: 1.25;
  color: #0f172a;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: #fff;
}
.az-sys-reg-table tbody tr:nth-child(even) td { background: #f8fafc; }
.az-sys-reg-table tbody tr:hover td { background: #eef4ff; }
.az-sys-reg-table tbody tr[data-editing="true"] td { background: #eff6ff; }
.az-sys-reg-table .az-brand-pill {
  padding: 1px 6px;
  font-size: 10px;
  line-height: 1.3;
}
.az-sys-reg-table .az-status-chip {
  padding: 1px 6px;
  font-size: 10px;
  line-height: 1.3;
}
.az-sys-reg-table .az-cell-desc,
.az-sys-reg-table .az-cell-file {
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.az-sys-reg-table td.az-cell-actions {
  display: table-cell;
  width: 86px;
  min-width: 86px;
  padding: 2px 6px;
  overflow: visible;
  white-space: nowrap;
  text-align: center;
}
.az-sys-reg-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex-wrap: nowrap;
  vertical-align: middle;
}
.az-sys-reg-table .az-edit-btn,
.az-sys-reg-table .az-copy-btn,
.az-sys-reg-table .az-del-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  margin: 0;
  box-shadow: none;
  border: 1px solid transparent;
  background: transparent;
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
}
.az-sys-reg-table .az-copy-btn {
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
}
.az-sys-reg-table .az-empty-row {
  text-align: center;
  white-space: normal;
  height: auto;
  padding: 14px 8px !important;
}

/* Toolbar for table header row */
.az-toolbar { display: flex; gap: 5px; margin-left: auto; }
.az-tool-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; font-size: 11px;
  background: #f8fafc; border: 1px solid var(--border);
  border-radius: 4px; color: var(--text-secondary);
  cursor: pointer; white-space: nowrap;
  transition: background 0.1s, border-color 0.1s, color 0.1s;
}
.az-tool-btn:hover { background: #eff6ff; border-color: #93c5fd; color: var(--accent); }
.az-tool-btn--danger:hover { background: #fee2e2; border-color: #fca5a5; color: #dc2626; }

/* Warn button (cancel edit) */
.az-btn--warn {
  padding: 5px 12px; font-size: 12px;
  background: #fff7ed; border: 1px solid #fed7aa;
  border-radius: var(--radius); color: #c2410c;
  cursor: pointer;
  transition: background 0.1s;
}
.az-btn--warn:hover { background: #ffedd5; }

/* Description cell */
.az-cell-desc { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--text-secondary); }

/* Fix scroll structure for az-panel flex layout — active pane only */
.az-panel > .az-tab-content.is-az-active {
  flex: 1 1 auto;
  min-height: 0;
}

/* When Admin is the sole center workspace, Formula Center must fill height */
body.sfx-ws-admin #adminZonePanel,
body.sfx-zone-admin #adminZonePanel {
  min-height: 0;
}
body.sfx-ws-admin [data-az-content="formula-center"].is-az-active,
body.sfx-zone-admin [data-az-content="formula-center"].is-az-active {
  flex: 1 1 auto;
  min-height: 0;
}

/* Profile Data — fill admin zone height (only while active) */
[data-az-content="profile-data"].pd-active.is-az-active {
  display: flex !important;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

/* Formula Center embed — medium Join Preview; Detail Library stays directly below it */
.fc-embed-host [data-az-content="detail-set"] {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.fc-embed-host [data-az-content="detail-set"] > .az-tab-toolbar {
  flex: 0 0 auto;
  position: static;
}
.fc-embed-host [data-az-content="detail-set"] > .az-section {
  flex: 1 1 auto;
  min-height: 0;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.fc-embed-host [data-az-content="detail-set"] > .az-section > .az-section-head {
  flex: 0 0 auto;
}
.fc-embed-host [data-az-content="detail-set"] > .az-section > .az-form-actions,
.fc-embed-host [data-az-content="detail-set"] .dtl-form-actions {
  flex: 0 0 auto;
}
.fc-embed-host [data-az-content="detail-set"] .dtl-ws {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  align-items: start;
  padding: 10px 12px;
}
.fc-embed-host [data-az-content="detail-set"] .dtl-ws-main {
  min-height: 0;
  height: auto;
  overflow: visible;
}
.fc-embed-host [data-az-content="detail-set"] .dtl-ws-side {
  display: flex;
  min-height: 0;
  height: auto;
  max-height: calc(100dvh - 132px);
  align-self: start;
  position: sticky;
  top: 8px;
}
.fc-embed-host [data-az-content="detail-set"] .dtl-ws-side-inner {
  position: static;
  flex: 1 1 auto;
  min-height: 0;
  height: calc(100dvh - 132px);
  max-height: calc(100dvh - 132px);
}
.fc-embed-host [data-az-content="detail-set"] .dtl-preview-host {
  height: 280px;
  min-height: 280px;
  max-height: 280px;
}
@media (max-width: 1180px) {
  .fc-embed-host [data-az-content="detail-set"] .dtl-ws {
    overflow: auto;
    align-items: start;
    height: auto;
  }
  .fc-embed-host [data-az-content="detail-set"] .dtl-ws-side,
  .fc-embed-host [data-az-content="detail-set"] .dtl-ws-side-inner {
    position: static;
    height: auto;
    max-height: none;
  }
  .fc-embed-host [data-az-content="detail-set"] .dtl-preview-host {
    height: 260px;
    min-height: 260px;
    max-height: 260px;
  }
}

.dtl-family-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
  padding: 4px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}
.fc-embed-host [data-az-content="detail-set"] .dtl-family-tabs,
.fc-embed-host [data-az-content="detail-set"] .az-section-note { display: none; }
.dtl-family-tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 9px;
  cursor: pointer;
}
.dtl-family-tab:hover { background: #fff; border-color: #cbd5e1; }
.dtl-family-tab.is-active {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}
.dtl-family-tab[hidden],
.dtl-family-tabs.is-fixed-detail [data-dtl-family="sash"] {
  display: none !important;
}
/* Family mode — 1) family folders · 2) editor canvas · 3) join preview */
.dtl-ws--fam { grid-template-columns: minmax(0, 1fr) minmax(330px, 27%) !important; align-items: stretch; }
.dtl-ws--fam.dtl-side-min { grid-template-columns: minmax(0, 1fr) 190px !important; }
.dtl-ws--fam > .dtl-ws-side { display: flex; min-height: 0; }
.dtl-ws--fam .dtl-ws-side-inner { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.dtl-ws--fam .dtl-preview-panel {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.dtl-ws--fam .dtl-preview-panel .dtl-preview-body { flex: 1 1 auto; min-height: 0; }
.dtl-ws--fam .dtl-preview-panel .dtl-preview-host {
  flex: 1 1 auto;
  height: auto;
  max-height: none;
}
@media (max-width: 1180px) {
  .dtl-ws--fam,
  .dtl-ws--fam.dtl-side-min { grid-template-columns: 1fr !important; }
}
.dtl-fam-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  min-height: 420px;
}
@media (max-width: 960px) {
  .dtl-fam-layout { grid-template-columns: 1fr; }
}
.dtl-fam-tree-panel {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  min-height: 420px;
  display: flex;
  flex-direction: column;
}
.dtl-fam-tree-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
}
.dtl-fam-tree { flex: 1; overflow: auto; padding: 8px; font-size: 12px; }
.dtl-fam-folder, .dtl-fam-item, .dtl-fam-side {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  color: #0f172a;
  font: inherit;
}
.dtl-fam-folder { font-weight: 800; }
.dtl-fam-item { font-weight: 600; padding-left: 18px; }
.dtl-fam-side { padding-left: 32px; color: #334155; }
.dtl-fam-side.is-auto {
  cursor: default;
  color: #9a3412;
  font-style: italic;
  opacity: .92;
}
.dtl-fam-side.is-auto:hover { background: transparent; }
.dtl-fam-folder:hover, .dtl-fam-item:hover, .dtl-fam-side:hover { background: #f1f5f9; }
.dtl-fam-item.is-active, .dtl-fam-side.is-active { background: #0f172a; color: #fff; }
.dtl-fam-kids { margin: 0 0 6px; }
.dtl-fam-empty { padding: 16px 10px; color: #64748b; line-height: 1.45; }
.dtl-fam-dot { width: 7px; height: 7px; border-radius: 50%; background: #cbd5e1; flex: 0 0 auto; }
.dtl-fam-dot.is-on { background: #16a34a; }
.dtl-fg-form {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  margin-bottom: 8px;
}
.dtl-fg-form--cover { grid-template-columns: 1fr 120px auto; align-items: end; }
.dtl-ws--fam.is-window-detail #azFgTrackField,
#azFgTrackField[hidden] {
  display: none !important;
}
.dtl-fg-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dtl-fg-lead { margin: 8px 0 0; font-size: 12px; line-height: 1.5; color: #475569; }
.dtl-cg-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.dtl-cg-row {
  display: grid;
  grid-template-columns: 1fr 90px auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  font-size: 12px;
}
.dtl-ws--fam #azDtlSideDetailWs > .az-form-grid,
.dtl-ws--fam #azDtlSideDetailWs > details.dtl-advanced { display: none !important; }
.dtl-ws--fam:not(.is-side) #azDtlSideWorkHost { display: none !important; }
.dtl-fam-work-hint {
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  line-height: 1.5;
}
.dtl-family-tab[data-dtl-family="interlock"]:not([hidden]) {
  color: #9a3412;
}
.dtl-family-tab[data-dtl-family="interlock"].is-active {
  background: #c2410c;
  border-color: #c2410c;
  color: #fff;
}
.dtl-family-tab[data-dtl-family="shrinked"]:not([hidden]) {
  color: #0f766e;
}
.dtl-family-tab[data-dtl-family="shrinked"].is-active {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
}
.fc-dtl-tab[data-dtl-tab="interlock"] { color: #9a3412; }
.fc-dtl-tab[data-dtl-tab="interlock"].active {
  background: #c2410c;
  border-color: #c2410c;
  color: #fff;
}
.fc-dtl-tab[data-dtl-tab="shrinked"] { color: #0f766e; }
.fc-dtl-tab[data-dtl-tab="shrinked"].active {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
}
.dtl-fg-form--shrinked {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px 12px;
  margin: 10px 0 12px;
}
.dtl-shr-import {
  margin-top: 6px;
  padding: 12px;
  border: 1px dashed #99f6e4;
  border-radius: 10px;
  background: #f0fdfa;
}
.dtl-shr-import-row {
  margin: 0 0 10px;
}
.dtl-shr-import-row label,
.dtl-shr-import-row .az-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #0f766e;
  margin: 0 0 4px;
}
.dtl-shr-cover-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.dtl-shr-cover-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid #99f6e4;
  border-radius: 8px;
  background: #fff;
  font-size: 11px;
  color: #134e4a;
}
.dtl-shr-cover-chip input { margin: 0; }
.dtl-shr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.dtl-ws--fam.is-shrinked-family .dtl-fam-work-hint {
  border-color: #99f6e4;
  background: #f0fdfa;
}
.dtl-ws--fam.is-sash-family .dtl-fam-work-hint { border-color: #93c5fd; background: #eff6ff; }
.dtl-ws--fam.is-interlock-family .dtl-fam-work-hint {
  border-color: #fdba74;
  background: #fff7ed;
}
.dtl-ws--fam.is-interlock-family #azDtlGlassSection,
.dtl-ws--fam.is-sash-family #azDtlGlassSection,
.dtl-ws--fam.is-shrinked-family #azDtlGlassSection,
.dtl-ws--fam.is-no-glass #azDtlGlassSection,
.dtl-ws--fam.is-interlock-family #azDtlAddGlassBtn,
.dtl-ws--fam.is-sash-family #azDtlAddGlassBtn,
.dtl-ws--fam.is-shrinked-family #azDtlAddGlassBtn,
.dtl-ws--fam.is-no-glass #azDtlAddGlassBtn,
.dtl-ws--fam.is-interlock-family #azDtlGlassAutoNote,
.dtl-ws--fam.is-sash-family #azDtlGlassAutoNote,
.dtl-ws--fam.is-shrinked-family #azDtlGlassAutoNote,
.dtl-ws--fam.is-no-glass #azDtlGlassAutoNote {
  display: none !important;
}
.dtl-ws--fam.is-side .dtl-fam-work-hint { display: none; }
.dtl-ws--fam:not(.is-side) .dtl-preview-host {
  opacity: 0.35;
  pointer-events: none;
}
.fc-embed-host [data-az-content="detail-set"] .dtl-ws--fam { grid-template-columns: minmax(0, 1fr) minmax(330px, 27%) !important; }
.fc-embed-host [data-az-content="detail-set"] .dtl-ws--fam.dtl-side-min { grid-template-columns: minmax(0, 1fr) 190px !important; }
@media (max-width: 1180px) {
  .fc-embed-host [data-az-content="detail-set"] .dtl-ws--fam,
  .fc-embed-host [data-az-content="detail-set"] .dtl-ws--fam.dtl-side-min { grid-template-columns: 1fr !important; }
}

.dtl-family-tab:hover { background: #fff; border-color: #cbd5e1; }
.dtl-family-tab.is-active {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}
.dtl-fg-lead {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.5;
  color: #475569;
}
.dtl-fg-lead b { color: #0f172a; }
.dtl-fg-tracks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}
.dtl-fg-track {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid #c7d2fe;
  border-radius: 10px;
  background: #eef2ff;
}
.dtl-fg-track b { font-size: 13px; color: #312e81; }
.dtl-fg-track span { font-size: 12px; font-weight: 600; color: #0f172a; }
.dtl-fg-track em { font-size: 10px; font-style: normal; color: #4338ca; letter-spacing: 0.02em; }
.dtl-fg-corners { display: flex; flex-direction: column; gap: 8px; }
.dtl-fg-corner-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) 90px 110px;
  gap: 8px;
  align-items: center;
}
.dtl-fg-corner-lab { font-size: 12px; font-weight: 700; color: #0f172a; }
.dtl-fg-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
  align-items: start;
}
@media (max-width: 1100px) {
  .dtl-fg-layout { grid-template-columns: 1fr; }
}
.dtl-fg-schematic {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #f8fafc);
  padding: 8px;
}
.dtl-fg-svg { width: 100%; height: auto; display: block; }
.dtl-fg-svg-lab { font-size: 9px; font-weight: 700; fill: #334155; }
.dtl-fg-svg-ang { font-size: 10px; font-weight: 800; fill: #b45309; }
.dtl-fg-svg-hint { font-size: 8px; fill: #64748b; }
.dtl-fg-sides { display: flex; flex-direction: column; gap: 10px; }
.dtl-fg-side {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}
.dtl-fg-side__head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 6px;
}
.dtl-fg-side__head b { font-size: 12px; color: #0f172a; }
.dtl-fg-pose { font-size: 10px; color: #64748b; }
.dtl-fg-side__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
}
.dtl-fg-ok { font-size: 11px; font-weight: 700; color: #15803d; margin-right: auto; }
.dtl-fg-miss { font-size: 11px; font-weight: 700; color: #b45309; margin-right: auto; }
.dtl-fg-badge {
  font-size: 10px;
  font-weight: 700;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 1px 7px;
}
.dtl-fg-card .dtl-lib-card__top { align-items: center; }

/* ── Detail Set — auto-hide panels (family tree / join preview / detail library) ── */
.dtl-autohide-btn {
  appearance: none;
  flex: 0 0 auto;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #475569;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
  padding: 4px 8px;
  cursor: pointer;
}
.dtl-autohide-btn:hover { background: #f1f5f9; color: #0f172a; border-color: #94a3b8; }
.dtl-lib-panel .dtl-autohide-btn {
  background: transparent;
  color: #cbd5e1;
  border-color: #334155;
}
.dtl-lib-panel .dtl-autohide-btn:hover { background: #1e293b; color: #fff; }
.dtl-autohide-rail,
.dtl-autohide-bar { display: none; }
.dtl-fam-tree-head-tools { display: flex; align-items: center; gap: 6px; }

/* Collapsed state: hide panel content, show slim reopen strip */
.dtl-fam-tree-panel.is-collapsed > *:not(.dtl-autohide-rail),
.dtl-preview-panel.is-collapsed > *:not(.dtl-autohide-bar),
.dtl-lib-panel.is-collapsed > *:not(.dtl-autohide-bar) { display: none !important; }

/* 1 · Family folders — collapses to a 40px vertical rail */
.dtl-fam-layout.dtl-tree-min { grid-template-columns: 40px minmax(0, 1fr); }
.dtl-fam-tree-panel.is-collapsed { min-height: 260px; }
.dtl-fam-tree-panel.is-collapsed > .dtl-autohide-rail {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 14px 4px;
  color: #475569;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.dtl-autohide-rail > span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; }
.dtl-fam-tree-panel.is-collapsed:hover { background: #f1f5f9; }

/* 3 · Join preview / 4 · Detail library — collapse to a slim header bar */
.dtl-preview-panel.is-collapsed > .dtl-autohide-bar,
.dtl-lib-panel.is-collapsed > .dtl-autohide-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  border: 0;
  cursor: pointer;
  padding: 9px 12px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.dtl-preview-panel.is-collapsed > .dtl-autohide-bar { background: #f8fafc; color: #334155; }
.dtl-preview-panel.is-collapsed > .dtl-autohide-bar:hover { background: #f1f5f9; color: #0f172a; }
.dtl-lib-panel.is-collapsed > .dtl-autohide-bar { background: #0f172a; color: #f8fafc; }
.dtl-lib-panel.is-collapsed > .dtl-autohide-bar:hover { background: #1e293b; }
.dtl-lib-panel.is-collapsed { flex: 0 0 auto; min-height: 0; }

/* When the library is hidden, let the join preview use the freed height */
.dtl-ws-side-inner:has(.dtl-lib-panel.is-collapsed) .dtl-preview-panel:not(.is-collapsed) { flex: 1 1 auto; }
.dtl-ws-side-inner:has(.dtl-lib-panel.is-collapsed) .dtl-preview-panel:not(.is-collapsed) .dtl-preview-body { flex: 1 1 auto; }
.dtl-ws-side-inner:has(.dtl-lib-panel.is-collapsed) .dtl-preview-panel:not(.is-collapsed) .dtl-preview-host {
  flex: 1 1 auto;
  height: auto;
  max-height: none;
}

.dtl-glass-auto-note {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #9a3412;
  font-size: 11px;
  line-height: 1.45;
}

