.vis-scope-val { font-size: 18px; }
.vis-scope-key { font-size: 16px; }
.matplot-image { max-width: 100%; border: 1px solid #ddd; margin: 10px 0; }
.output-section { background: #f7f8fb; padding: 1em; border-radius: 12px; margin-top: 1em; border: 1px solid #e6e9f2; box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06); }
.stdout, .stderr { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; white-space: pre-wrap; padding: 0; margin: 0; }
.stdout {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  line-height: 1.5;
  font-size: 13px;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.2);
}
#matplot-stdout {
  padding: 12px 14px !important;
  box-sizing: border-box;
}
.stdout code {
  color: inherit;
  background: transparent;
  padding: 0;
}
.stderr { color: #f87171; }
.stdout .error { color: #fca5a5; }
.stdout .table-responsive {
  background: #f8fafc;
  padding: 10px;
  border-radius: 8px;
  margin: 8px 0;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.25);
}
#matplot-stdout table,
.stdout table,
.stdout table.table,
.pynerds-df {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  color: #0f172a !important;
  background: #ffffff !important;
}
#matplot-stdout table thead th,
.stdout table thead th,
.stdout table.table thead th,
.pynerds-df thead th {
  background: #f1f5f9;
  color: #0f172a !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
  position: sticky;
  top: 0;
  z-index: 1;
}
#matplot-stdout table th,
#matplot-stdout table td,
.stdout table th,
.stdout table td,
.stdout table.table th,
.stdout table.table td,
.pynerds-df th,
.pynerds-df td {
  border: 1px solid rgba(148, 163, 184, 0.2) !important;
  padding: 6px 8px;
}
#matplot-stdout table tbody tr:nth-child(odd),
.stdout table tbody tr:nth-child(odd),
.stdout table.table tbody tr:nth-child(odd),
.pynerds-df tbody tr:nth-child(odd) {
  background: #f8fafc;
}
#matplot-stdout table *{
  color: #0f172a !important;
  background-color: transparent;
}
#matplot-stdout table thead th{
  background-color: #f1f5f9 !important;
}
#id_text{visibility:hidden}

#file-tabs {
  overflow-x: auto; white-space: nowrap; 
}
.editor-section {
  background: #ffffff;
  border: none;
  border-radius: 0;
  box-shadow: none;
}
.editor-loading-note {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 3;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(247, 250, 252, 0.95) 100%);
  color: #4b5563;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  pointer-events: none;
}
.editor-loading-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(71, 85, 105, 0.22);
  border-top-color: #28a745;
  border-radius: 50%;
  animation: editor-loader-spin 0.75s linear infinite;
}
.editor-section[data-editor-ready="0"] {
  min-height: 220px;
}
.editor-section[data-editor-ready="0"] .editor-loading-note {
  display: inline-flex;
}
.editor-section[data-editor-ready="0"] #file-tabs,
.editor-section[data-editor-ready="0"] .editor-holder {
  visibility: hidden;
}
.editor-section[data-editor-ready="1"] #file-tabs,
.editor-section[data-editor-ready="1"] .editor-holder {
  visibility: visible;
}
#file-tabs {
  background: #eef1f5;
  border-bottom: 1px solid #d6dbe4;
  border-radius: 0;
}
#add-file {
  cursor: pointer; padding: 2px 8px; border: 1px solid #28a745; border-radius: 6px; margin-right: 5px; font-size: 13px; background-color: #28a745; color: #fff; box-shadow: none;
}
#add-file:hover {
  background-color: #218838; color: white;
}
.close-file{
  display: none; margin-left: 5px; cursor: pointer;
}
.file-name:hover .close-file:not(.d-none) {
  display: inline !important;
}
.file-name.active .close-file {
  display: inline !important;
}
#id_text{display:none !important}
textarea[data-for]{ display:none !important}
.file-name { cursor: pointer; padding: 2px 8px; border: 1px solid #fff; border-radius: 6px 6px 0 0; margin-right: 5px; font-size: 13px; background-color: #d7d7d7; color: #1f2937; }
.file-name.active { background-color: #ffffff; border-color: #28a745; border-bottom-color: #ffffff; color: #1f2937; box-shadow: none; }
.ace_editor { border: none; border-top: none; border-radius: 0; box-shadow: none; }

.bubble-connection {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin: 0px;
  border-radius: 50%;
  background: white;
  overflow: visible; /* allow ripple to expand */
}

.bubble-connection svg {
  width: 10px;
  height: 10px;
  fill: #4fc3f7;
  z-index: 2;
}
.bubble-connection.inactive svg{
  fill: gray;
}
.bubble-connection.inactive{
}
.bubble-connection.inactive:before,
.bubble-connection.inactive:after{
  animation: none;
  opacity: 0.2;
  background: gray;

}

.bubble-connection::before,
.bubble-connection::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(79, 195, 247, 0.8);
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  transform: scale(1);
  opacity: 0.6;
  z-index: 1;
  animation: ripple 1.5s infinite;
}

.bubble-connection::after {
  animation-delay: 0.75s;
}

@keyframes editor-loader-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes ripple {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  100% {
    transform: scale(2.5);
    opacity: 0;
  }
}

.tool-output-toolbar,
.table-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  background: #f2f4f8;
  border: 1px solid #e3e6ed;
  border-radius: 8px;
  padding: 8px 10px;
  margin: 12px 0 8px;
}
.tool-output-toolbar .toolbar-group,
.table-tools .toolbar-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.tool-output-toolbar .btn-tool,
.table-tools .btn-tool {
  border: 1px solid #cfd6e4;
  background: #fff;
  color: #2c3e50;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 13px;
  cursor: pointer;
}
.btn-tool {
  border: 1px solid #cfd6e4;
  background: #ffffff;
  color: #1f2937;
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-tool-compact {
  padding: 4px 8px;
  border-radius: 6px;
  min-width: 34px;
  justify-content: center;
}
.btn-tool-icon {
  background: transparent;
  border: none;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.btn-tool-icon:hover svg {
  transform: translateY(-1px);
}
.btn-tool-icon svg {
  transition: transform .15s ease;
}
.btn-tool:hover {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #1f2937;
}
.tool-output-toolbar .btn-tool.active,
.table-tools .btn-tool.active {
  background: #2d6cdf;
  color: #fff;
  border-color: #2d6cdf;
}
.tool-output-toolbar select,
.table-tools select {
  border: 1px solid #cfd6e4;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 13px;
  background: #fff;
}
.plots-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.section-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:6px;
}
.section-title{
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.section-chip{
  font-size:11px;
  color:#4b5563;
  background:#eef2ff;
  border:1px solid #c7d2fe;
  padding:2px 6px;
  border-radius:999px;
  text-transform:uppercase;
  letter-spacing:.02em;
}
.plots-toolbar{
  display:inline-flex;
  align-items:center;
  gap:6px;
}
.plots-toolbar .btn-tool{
  border: 1px solid #cfd6e4;
  background: #fff;
  color: #2c3e50;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
  cursor: pointer;
}
.plots-toolbar .btn-tool.active{
  background: #2d6cdf;
  color: #fff;
  border-color: #2d6cdf;
}
.run-meta {
  font-size: 12px;
  color: #6b7280;
}
#matplot-images.plot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
#matplot-images.plot-single {
  display: block;
}
#matplot-images.plot-single .matplot-image {
  width: 100%;
}
.table-tools input[type="search"] {
  border: 1px solid #cfd6e4;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 13px;
  min-width: 180px;
}
.table-summary {
  font-size: 12px;
  color: #4b5563;
}

.matplot-image {
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.plot-card{
  display:inline-block;
  position:relative;
  margin:0 10px 10px 0;
}
.plot-overlay{
  position:absolute;
  top:8px;
  right:8px;
  display:flex;
  gap:6px;
  opacity:0;
  transition:opacity .15s ease;
}
.plot-card:hover .plot-overlay{
  opacity:1;
}
.plot-action{
  border:1px solid rgba(15,23,42,.2);
  background:rgba(255,255,255,.92);
  color:#0f172a;
  border-radius:6px;
  padding:3px 8px;
  font-size:12px;
  text-decoration:none;
  cursor:pointer;
}
.matplot-image:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14);
}

.collab-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 8px 10px;
  margin-top: 0;
  border-bottom: 1px solid #d6dbe4;
}
.collab-editor-shell {
  background: #eef1f5;
  border: 1px solid #d6dbe4;
  border-radius: 12px;
  overflow: hidden;
}
.collab-editor-wrap .editor-section {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-top: none;
  border-radius: 0 0 12px 12px;
}
.collab-presence {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.presence-label {
  font-size: 12px;
  color: #4b5563;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.presence-count {
  font-weight: 600;
  font-size: 13px;
  color: #111827;
}
.presence-dot {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid #d1d5db;
}
.collab-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.collab-share-panel {
  margin-top: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
}
.collab-activity {
  margin-top: 12px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px 12px;
}
.activity-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #6b7280;
  margin-bottom: 6px;
}
.activity-list {
  margin: 0;
  padding-left: 16px;
  font-size: 13px;
  color: #374151;
}
.activity-item {
  margin: 4px 0;
}
.collab-help {
  margin-top: 10px;
}
.help-toggle {
  border: 1px dashed #cbd5f5;
  background: #f8fafc;
  color: #1f2937;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.help-toggle:hover {
  background: #eef2ff;
}
.collab-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: #0f172a;
  color: #f8fafc;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.35);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
  z-index: 40;
}
.collab-toast.show {
  opacity: 1;
  transform: translateY(0);
}
.share-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.collab-session-bar {
  margin: 6px 0 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.collab-lock-note {
  font-size: 12px;
  color: #b91c1c;
  background: #fff1f2;
  border: 1px dashed #fecaca;
  border-radius: 8px;
  padding: 6px 10px;
  margin: 0;
  display: inline-block;
}
.collab-lock-note-inline {
  font-size: 11px;
  color: #b91c1c;
  background: #fff1f2;
  border: 1px dashed #fecaca;
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 8px;
  white-space: nowrap;
}
.session-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  font-size: 12px;
  color: #111827;
}
.pill-label {
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: 10px;
  color: #6b7280;
}
.pill-value {
  font-weight: 600;
}
.status-pill.status-ok {
  color: #0f766e;
}
.status-pill.status-bad {
  color: #b91c1c;
}
.status-pill.status-warn {
  color: #b45309;
}
.collab-quicktips {
  margin-top: 10px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px 12px;
}
.quicktips-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #6b7280;
  margin-bottom: 6px;
}
.quicktips-list {
  margin: 0;
  padding-left: 16px;
  font-size: 13px;
  color: #374151;
}
.quicktips-list li {
  margin: 4px 0;
}
.share-title {
  font-size: 12px;
  color: #4b5563;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.share-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.share-input {
  flex: 1;
  border: 1px solid #cfd6e4;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  background: #fff;
  color: #1f2937;
}
.collab-ribbon {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #fee2e2;
  color: #991b1b;
  border-bottom: 1px solid #fecaca;
  padding: 6px 12px;
  text-align: center;
  font-size: 13px;
}
