.workspace-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 20px 0 0;
  padding: 4px 4px 0;
  border-bottom: 1px solid var(--line);
}

.workspace-tabs a {
  padding: 10px 14px;
  border-bottom: 3px solid transparent;
  border-radius: 6px 6px 0 0;
  color: #43575d;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.workspace-tabs a:hover { background: #eaf5f3; }
.workspace-tabs a[aria-current="page"] {
  border-bottom-color: var(--teal);
  background: white;
  color: #086c64;
}

#visualMappingHost .visual-mapping-workspace {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

#statisticsFrame, #auditFrame {
  display: block;
  width: 100%;
  height: 70vh;
  border: 0;
}

.audit-embedded.admin-page { padding: 0; }
.audit-embedded .admin-head { display: none; }
.about-panel { max-width: 640px; }
.about-panel .about-content { padding: 0; }
.gateway-runtime-controls { margin-top: 16px; padding: 8px 5px 0; }
.gateway-runtime-switch { display: flex; align-items: center; gap: 6px; }
.gateway-runtime-switch button { width: 29px; height: 29px; padding: 0; border-radius: 5px; color: white; font-size: 15px; }
#gatewayRuntimeStart { background: #168343; border-color: #36a765; }
#gatewayRuntimeStop { background: #af3339; border-color: #cb5558; }
.gateway-runtime-switch button:disabled { opacity: .45; cursor: default; }
#gatewayRuntimeState { padding-left: 3px; color: #e4ecea; font-size: 13px; font-weight: 700; }
#gatewayRuntimeState[data-state="running"] { color: #64e59f; }
#gatewayRuntimeState[data-state="stopped"] { color: #ff9a9a; }
#gatewayRuntimeState[data-state="pending"] { color: #ffd77e; }
#gatewayRuntimeDetail { display: block; margin-top: 5px; color: #a9bfbe; font-size: 11px; }
#gatewayRuntimeControls[data-state="running"] #gatewayRuntimeStart:disabled,
#gatewayRuntimeControls[data-state="stopped"] #gatewayRuntimeStop:disabled { opacity: 1; }
#gatewayRuntimeControls:not([hidden]) + nav { margin-top: 18px; }
@media (max-width: 850px) { .gateway-runtime-controls { margin-top: 0; padding-top: 0; } }

.mapping-actions, #mappingFileActions { align-items: center; }
.mapping-csv-menu { position: relative; }
.mapping-csv-menu summary { padding: 9px 12px; border: 1px solid var(--line); border-radius: 7px; background: white; color: #304249; cursor: pointer; font-size: 13px; font-weight: 600; white-space: nowrap; }
.mapping-csv-menu[open] > div { position: absolute; top: calc(100% + 5px); right: 0; z-index: 5; display: grid; min-width: max-content; gap: 4px; padding: 5px; border: 1px solid var(--line); border-radius: 7px; background: white; box-shadow: 0 6px 16px #102d3426; }
.mapping-csv-menu button { text-align: left; }
#importStatus { white-space: pre-line; overflow-wrap: anywhere; }

.workspace-actions { align-items: center; justify-content: flex-end; }
.workspace-lock { display: flex; align-items: center; gap: 5px; padding: 6px; white-space: nowrap; cursor: pointer; }
.workspace-lock input { accent-color: var(--teal); }
body.workspace-locked {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
}
.workspace-locked > main { display: flex; flex-direction: column; min-height: 0; overflow: hidden; padding-block: clamp(8px, 2vh, 24px); }
.workspace-locked > main > :not([data-workspace-view]) { flex: 0 0 auto; }
.workspace-locked > main > [data-workspace-view] { flex: 1 1 auto; min-height: 0; max-width: 100%; overflow: auto; }
.workspace-locked .workspace-tabs { flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; }
.workspace-locked > aside { min-height: 0; height: 100%; overflow-y: auto; }
@media (max-width: 850px) {
  body.workspace-locked { display: grid; grid-template-columns: minmax(0,1fr); grid-template-rows: auto minmax(0,1fr); }
  .workspace-locked > main { padding-inline: 12px; }
  .workspace-locked > main > header { flex-wrap: wrap; gap: 5px; }
}
@media (max-height: 460px) {
  .workspace-locked > main { overflow-y: auto; }
  .workspace-locked > main > [data-workspace-view] { flex: 0 0 auto; }
}
