.nb-dialog {
  box-sizing: border-box;
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  width: min(850px, 100vw);
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  padding: 22px;
  overflow: auto;
  border: 0;
  border-left: 1px solid var(--border);
  color: var(--text-1);
  background: var(--bg-1);
}
.nb-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}
.nb-header,
.nb-tabs,
.nb-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.nb-header h2 {
  flex: 1;
  margin: 0;
}
.nb-tabs {
  margin: 18px 0 10px;
}
.nb-tabs [aria-selected="true"] {
  border-color: var(--accent);
  color: var(--accent);
}
.nb-note,
.nb-status,
.nb-caption {
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.nb-note {
  margin: 10px 0;
}
.nb-status:empty {
  display: none;
}
.nb-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.nb-card,
.nb-record {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-2);
}
.nb-card h3,
.nb-body h3 {
  margin: 8px 0;
  font-size: 15px;
  overflow-wrap: anywhere;
}
.nb-record {
  margin: 12px 0;
}
.nb-preview {
  width: 100%;
  display: block;
  border: 1px solid var(--border);
  padding: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-0);
  color: var(--text-1);
  text-align: left;
  cursor: pointer;
}
.nb-preview:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.nb-thumbnail {
  display: block;
  width: 100%;
  height: auto;
}
.nb-thumbnail[hidden] {
  display: none;
}
.nb-caption {
  display: block;
  min-height: 42px;
  padding: 10px;
}
.nb-live-image {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  background: var(--bg-2);
}
.nb-live-image:not([src]) {
  display: none;
}
.nb-controlling {
  cursor: crosshair;
}
.nb-input-controls {
  margin-top: 14px;
}
.nb-input-controls input {
  min-width: 0;
  flex: 1 1 240px;
}
#topbar-browsers-btn {
  display: inline-flex;
  flex-shrink: 0;
}
@media (max-width: 600px) {
  .nb-dialog {
    padding: 16px;
  }
  .nb-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .nb-header {
    gap: 6px;
  }
  .nb-controls button,
  .nb-tabs button {
    min-height: 40px;
  }
}
