@font-face {
  font-family: "balbek-pro-cut";
  src: url("./assets/fonts/BalbekProCut-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "balbek-pro-cut";
  src: url("./assets/fonts/BalbekProCut-Oblique.woff2") format("woff2");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg: #0d0d0d;
  --panel: #1f1f1f;
  --panel-2: #252525;
  --panel-3: #171717;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.42);
  --muted-strong: rgba(255, 255, 255, 0.58);
  --accent: #f1f1ef;
  --accent-soft: rgba(255, 255, 255, 0.08);
  --accent-glow: rgba(255, 255, 255, 0.04);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  --surface: var(--panel);
  --surface-soft: rgba(255, 255, 255, 0.03);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --font-ui: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "balbek-pro-cut", var(--font-ui);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.02), transparent 22%),
    radial-gradient(circle at 16% 18%, rgba(255, 255, 255, 0.015), transparent 16%),
    linear-gradient(180deg, #111111 0%, #090909 100%);
  font-family: var(--font-ui);
  letter-spacing: 0;
}

body.is-resizing,
body.is-resizing * {
  cursor: ns-resize !important;
}

body.has-drawer-open {
  overflow: hidden;
}

body.has-modal-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.app-shell {
  width: 100%;
  margin: 0;
  padding: 0 0 20px;
}

.db-header,
.collection-surface,
.note-sidebar,
.overlay-panel,
.record-card,
.record-list-row,
.record-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: none;
}

.db-header {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 14px 0 10px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(180deg, rgba(25, 25, 25, 0.96), rgba(25, 25, 25, 0.88) 82%, rgba(25, 25, 25, 0));
  box-shadow: none;
}

.db-toolbar {
  display: grid;
  gap: 12px;
  align-items: center;
}


.db-toolbar-primary {
  grid-template-columns: auto minmax(220px, 320px) 1fr auto;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  width: min(1660px, calc(100vw - 24px));
  margin: 0 auto;
}

.toolbar-stats,
.toolbar-filters,
.toolbar-actions,
.secondary-actions,
.source-buttons,
.layout-toggle,
.items-per-page-control,
.pagination-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.toolbar-stats {
  min-width: 0;
}

.toolbar-stats span,
.db-view-chip {
  min-height: 24px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.toolbar-brand-home {
  padding: 0;
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.toolbar-brand-logo {
  display: block;
  width: auto;
  max-width: 80px;
  max-height: 32px;
  object-fit: contain;
}

.db-view-chip strong {
  color: var(--text);
  font-weight: 500;
}

.db-search {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
}

.db-search input,
.panel-field input,
.panel-field select,
.db-sort select {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 14px;
}

.db-filter,
.db-toolbar-action,
.items-per-page-control,
.db-primary-action,
.icon-button,
.note-action,
.panel-row-button,
.saved-view-main,
.saved-view-delete,
.property-row {
  min-height: 31px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.db-filter,
.db-toolbar-action,
.items-per-page-control,
.panel-row-button,
.saved-view-main,
.property-row {
  padding: 6px 10px;
}

.items-per-page-control {
  min-height: 31px;
  gap: 6px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
}

.items-per-page-control select {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.db-filter.is-active,
.db-toolbar-action.is-active,
.icon-button.is-active {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.note-action,
.panel-row-button,
.saved-view-main,
.saved-view-delete,
.property-row {
  border-color: transparent;
  background: transparent;
}

.db-primary-action {
  min-height: 32px;
  padding: 0 12px;
  min-width: 0;
  color: #141414;
  background: #ff9700;
  border-color: #ff9700;
  font-weight: 600;
  font-size: 13px;
}

.db-toolbar-action {
  min-height: 31px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted-strong);
  font-size: 12px;
}

.db-toolbar-action i {
  font-size: 14px;
}

.db-toolbar-action span {
  line-height: 1;
}

.icon-button {
  width: 32px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  color: var(--muted-strong);
}

.db-filter.icon-filter {
  width: 31px;
  padding: 0;
  display: inline-grid;
  place-items: center;
}

.db-filter.icon-filter i {
  font-size: 14px;
  color: #fff;
}

.db-filter-text {
  min-width: 32px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 600;
}

.db-filter.icon-filter img {
  display: block;
  width: 17px;
  height: 17px;
  opacity: 1;
}

.db-filter.icon-filter.is-active img {
  opacity: 1;
}

.db-search i,
.icon-button i,
.panel-row-button i,
.saved-view-main i,
.saved-view-delete i,
.property-row i,
.meta-token i,
.note-property-label i,
.panel-view-icon i,
.db-view-chip i,
.media-kind-flag i,
.preview-play i {
  color: #fff;
}

.field-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
}

.field-icon-mask {
  width: 14px;
  height: 14px;
  background-color: #fff;
  -webkit-mask-image: var(--icon-url);
  mask-image: var(--icon-url);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  opacity: 0.92;
}

.property-row-copy .field-icon-mask,
.note-property-label .field-icon-mask,
.meta-token .field-icon-mask {
  width: 15px;
  height: 15px;
}

.db-sort {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  text-transform: uppercase;
  color: var(--muted);
}

.workspace {
  display: grid;
  grid-template-columns: 304px minmax(0, 1fr);
  gap: 18px;
  margin-top: 8px;
  width: min(1660px, calc(100vw - 24px));
  margin-left: auto;
  margin-right: auto;
  align-items: start;
}

.collections-sidebar {
  position: sticky;
  top: 16px;
  align-self: start;
}

.collection-surface {
  min-height: calc(100vh - 170px);
  padding: 8px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.collection-root {
  --row-preview-width: 300px;
}

.collections-nav {
  border: 0;
  background: transparent;
  border-radius: 0;
  padding: 4px 2px;
}

.collections-nav-head {
  padding: 4px 8px 8px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
}

.collections-nav-shell > .collections-nav-node:first-child {
  margin-bottom: 10px;
}

.collections-nav-group {
  margin-top: 6px;
}

.collections-nav-section,
.collections-nav-main,
.collections-nav-select,
.collections-nav-caret,
.collections-nav-add,
.media-category-row,
.record-collection-action,
.collection-popover-create {
  border: 0;
  background: transparent;
  color: inherit;
}

.collections-nav-section {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  font-size: 11px;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.5);
}

.collections-nav-section-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.collections-nav-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  min-height: 28px;
  padding-left: calc(var(--collection-depth, 0) * 14px);
  border-radius: 8px;
}

.collections-nav-row:hover {
  background: rgba(255, 255, 255, 0.035);
}

.collections-nav-row.is-active {
  background: rgba(255, 255, 255, 0.055);
}

.collections-nav-caret,
.collections-nav-add,
.collections-nav-inline-action {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  opacity: 0.7;
}

.collections-nav-caret i {
  width: 10px;
  height: 10px;
  display: inline-grid;
  place-items: center;
  font-size: 10px;
  line-height: 1;
}

.collections-nav-caret.is-placeholder {
  pointer-events: none;
}

.collections-nav-main {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 6px 4px 0;
  font-size: 13px;
  text-align: left;
}

.collections-nav-main-leading,
.collections-nav-main-trailing {
  min-width: 0;
  display: inline-flex;
  align-items: center;
}

.collections-nav-main-leading {
  gap: 6px;
  flex: 1;
}

.collections-nav-main-trailing {
  flex: 0 0 auto;
  gap: 8px;
  padding-left: 10px;
}

.collections-nav-label {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.collections-nav-select {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  text-align: left;
  flex: 1;
}

.collections-nav-select i,
.media-category-label i,
.media-category-label .field-icon {
  width: 14px;
  min-width: 14px;
  display: inline-flex;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
}

.collections-nav-label span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collections-nav-select span:last-child,
.media-category-label span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collections-nav-row.is-active .collections-nav-label span:last-child {
  font-weight: 600;
}

.collections-nav-meta {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.46);
}

.collections-nav-inline-action {
  border: 0;
  padding: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.56);
  flex: 0 0 auto;
}

.collections-nav-inline-action i {
  font-size: 12px;
  line-height: 1;
}

.collections-nav-inline-action-settings i {
  font-size: 13px;
}

.collections-nav-row:hover .collections-nav-inline-action,
.collections-nav-row.is-active .collections-nav-inline-action {
  color: rgba(255, 255, 255, 0.78);
}

.collections-nav-main-create {
  justify-content: flex-start;
  color: rgba(255, 255, 255, 0.56);
}

.collections-nav-row-create:hover .collections-nav-main-create {
  color: rgba(255, 255, 255, 0.82);
}

.media-category-nav {
  display: grid;
  gap: 3px;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.media-category-list {
  display: grid;
  gap: 2px;
}

.media-category-row {
  min-height: 28px;
  padding: 4px 8px 4px 18px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.72);
  text-align: left;
}

.media-category-row:hover,
.media-category-row.is-active {
  background: rgba(255, 255, 255, 0.045);
  color: rgba(255, 255, 255, 0.92);
}

.media-category-label {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.records-grid {
  display: grid;
  gap: 8px;
}

.records-grid-cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.record-card,
.record-list-row,
.record-row {
  overflow: hidden;
}

.record-card.is-selected,
.record-list-row.is-selected,
.record-row.is-selected {
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: none;
}

.record-card {
  display: grid;
  grid-template-rows: auto 1fr;
}

.record-preview-frame,
.record-list-preview,
.record-row-preview,
.note-preview-shell {
  position: relative;
  background: #0d1215;
}

.record-card .record-preview-frame,
.record-card .preview-link-shell,
.record-card .preview-link {
  aspect-ratio: 16 / 9;
}

.record-list-row {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr);
  background: #1e1e1e;
  align-items: stretch;
}

.record-list-preview {
  width: 136px;
  height: 242px;
  align-self: stretch;
  background: #090909;
  overflow: hidden;
}

.record-row {
  display: grid;
  grid-template-columns: var(--row-preview-width) minmax(0, 1fr);
  grid-template-rows: auto 18px;
  align-items: center;
  background: #1e1e1e;
  position: relative;
  overflow: visible;
}

.record-row-preview {
  min-height: auto;
  aspect-ratio: 1 / 1;
  align-self: center;
  grid-column: 1;
  grid-row: 1;
  background: #090909;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.record-list-row .preview-link-shell,
.record-list-row .preview-link {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
}

.record-row .preview-link-shell,
.record-row .preview-link {
  aspect-ratio: 1 / 1;
}

.record-body,
.record-list-main,
.record-row-main {
  padding: 14px 16px;
}

.record-card .record-body {
  background: #1a1a1a;
}

.record-card .record-row-properties,
.record-list-row .record-row-properties,
.record-row .record-row-properties {
  background: #141414;
}

.record-row-main {
  min-width: 0;
  grid-column: 2;
  grid-row: 1;
}

.record-list-main,
.record-row-main {
  background: #262626;
}

.record-overline,
.panel-kicker,
.note-kicker,
.panel-section-label {
  color: var(--muted);
  letter-spacing: 0;
  font-size: 12px;
  font-weight: 500;
}

.record-overline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.record-card .mini-label,
.record-card .record-overline .db-flag,
.record-card .record-overline .meta-token {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 0;
  color: var(--muted);
  box-shadow: none;
}

.record-card .mini-label.is-horizontal,
.record-card .mini-label.is-vertical,
.record-card .mini-label.is-square,
.record-card .mini-label.is-unknown {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.record-card h3,
.record-list-row h3,
.record-row h3,
.note-document h2,
.note-sidebar-head h2,
.panel-header h3 {
  margin: 0;
  line-height: 1.2;
  font-weight: 600;
  font-family: var(--font-display);
  letter-spacing: 0.02em;
}

.record-card h3,
.record-list-row h3,
.record-row h3 {
  font-size: 19px;
}

.record-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: nowrap;
  margin-top: 6px;
  margin-bottom: 12px;
}

.record-title-row h3 {
  min-width: 0;
  display: inline;
}

.drive-title-link {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 14px;
  color: #fff;
  text-decoration: none;
  align-self: center;
  transform: translateY(1px);
}

.drive-title-link i {
  width: 14px;
  height: 14px;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.record-list-head > .record-title-row,
.record-row-head > div > .record-title-row {
  display: inline-flex;
  max-width: 100%;
}

.record-summary,
.note-summary,
.empty-copy,
.note-empty p {
  margin: 8px 0 0;
  color: var(--muted-strong);
  line-height: 1.45;
  font-size: 13px;
}

.record-list-row .record-summary,
.record-row .record-summary {
  color: rgba(255, 255, 255, 0.62);
  padding: 0 16px;
}

.record-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.record-meta.compact {
  margin-top: 14px;
}

.record-frontmatter-accordion {
  margin-top: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
}

.record-frontmatter-accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  padding: 8px 12px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 600;
  list-style: none;
}

.record-frontmatter-accordion summary::-webkit-details-marker {
  display: none;
}

.record-frontmatter-accordion summary span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.record-frontmatter-accordion summary > i {
  color: var(--muted);
  font-size: 10px;
  transition: transform 160ms ease;
}

.record-frontmatter-accordion[open] summary > i {
  transform: rotate(180deg);
}

.record-frontmatter-body {
  padding: 0 12px 12px;
}

.record-list-row .record-meta,
.record-row .record-meta {
  gap: 8px;
}

.pagination-bar {
  justify-content: center;
  padding: 16px 0 8px;
}

.pagination-button {
  min-height: 31px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.pagination-button:disabled {
  cursor: default;
  opacity: 0.38;
}

.pagination-status {
  color: var(--muted);
  font-size: 12px;
}

.note-atom-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 12px;
}

.record-atom-column {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.record-atom-column-label {
  color: var(--muted);
  font-size: 11px;
}

.record-atom-column-value {
  min-width: 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.3;
  word-break: break-word;
}

.record-atom-column.is-empty .record-atom-column-value {
  color: var(--muted);
}

.meta-token,
.mini-label,
.db-flag {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 4px;
}

.meta-token {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 7px 11px;
  color: var(--muted);
  font-size: 12px;
  background: rgba(0, 0, 0, 0.33);
}

.meta-token-button {
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.meta-token-button:hover {
  border-color: rgba(208, 214, 255, 0.3);
  color: var(--text);
}

.meta-token strong {
  color: var(--text);
  font-weight: 500;
}

.meta-token-colors {
  align-items: center;
}

.color-token-list {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.color-token-value {
  color: var(--color-token-accent, #ffb347);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.db-flag,
.mini-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 20px;
  padding: 3px 8px;
  font-size: 11px;
  line-height: 1;
  font-weight: 600;
  color: #fff;
}

.usage-flag-icon {
  width: 16px;
  height: 16px;
  display: block;
  flex: 0 0 16px;
}

.resolution-flag {
  min-width: 30px;
}

.db-flag.is-6k {
  border-color: rgba(255, 255, 255, 0.78);
  background: #e8e8e8;
  color: #111;
}

.db-flag.is-a-roll,
.mini-label.is-horizontal {
  border-color: rgba(2, 137, 211, 0.7);
  background: #0289d3;
}

.db-flag.is-b-roll,
.mini-label.is-vertical {
  border-color: rgba(255, 115, 235, 0.7);
  background: #ff73eb;
}

.db-flag.is-non-marketing,
.mini-label.is-square {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
}

.db-flag.is-4k {
  border-color: rgba(255, 151, 0, 0.7);
  background: #ff9700;
}

.db-flag.is-2k {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
}

.db-flag.is-1080,
.db-flag.is-horizontal {
  border-color: rgba(128, 128, 128, 0.7);
  background: #808080;
}

.db-flag.is-720,
.db-flag.is-unknown,
.mini-label.is-unknown {
  border-color: rgba(204, 18, 37, 0.7);
  background: #cc1225;
}

.preview-link {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  min-height: inherit;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
}

.preview-link-shell {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: inherit;
}

.preview-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #0a0a0a;
}

.preview-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #0a0a0a;
}

.preview-video-fallback {
  background: #0a0a0a;
}

.preview-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(25, 25, 25, 0.88);
  pointer-events: none;
}

.media-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 39;
  background: rgba(0, 0, 0, 0.58);
}

.media-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 40;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
  padding: 14px;
  width: min(960px, calc(100vw - 64px));
  max-width: calc(100vw - 64px);
  transform: translate(-50%, -50%);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(19, 19, 19, 0.96);
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.45);
}

.media-modal.is-hidden,
.media-modal-backdrop.is-hidden {
  display: none;
}

.media-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.media-modal-body {
  min-height: 0;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #0a0a0a;
}

.media-modal-body iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #0a0a0a;
}

.fluidbox-overlay {
  background: rgba(0, 0, 0, 0.72) !important;
}

.fluidbox-wrap,
.fluidbox-ghost {
  background-color: #0a0a0a !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
}

.preview-flag-cluster {
  position: absolute;
  display: flex;
  gap: 0;
}

.preview-flag-cluster.left {
  top: 8px;
  left: 8px;
}

.preview-flag-cluster.right {
  top: 8px;
  right: 8px;
}

.preview-flag-cluster.right .db-flag {
  min-height: 16px;
  padding: 2px 6px;
  font-size: 9px;
}

.preview-flag-cluster.bottom-left {
  top: auto;
  left: 8px;
  bottom: 8px;
}

.media-kind-flag {
  min-width: 20px;
  min-height: 20px;
  padding: 3px 7px;
  color: #fff;
  background: rgba(15, 15, 15, 0.82);
  border-radius: 3px;
  border-color: transparent;
  border-width: 0;
}

.record-preview-frame .db-flag {
  border-radius: 0;
}

.record-list-head,
.record-row-head,
.panel-header,
.note-sidebar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.inline-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}

.record-row-properties {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 0 18px;
  margin-top: 10px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0 16px;
}

.record-property-inline {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px 6px;
}

.record-property-label {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.record-property-value {
  min-width: 0;
  font-size: 13px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-divider {
  position: absolute;
  width: 100%;
  height: 18px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: ns-resize;
  left: 0;
  right: 0;
  z-index: 2;
}

.row-divider::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 6px;
  transform: translate(-50%, -50%);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.row-divider.is-between {
  bottom: -10px;
}

.sidebar-root {
  min-height: 0;
}

.note-drawer {
  position: fixed;
  top: 18px;
  right: 0;
  z-index: 20;
  width: min(500px, calc(100vw - 24px));
  height: calc(100vh - 18px);
  padding: 22px 18px 24px;
  overflow: auto;
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  border-top-left-radius: 14px;
  background: #1c1c1c;
  box-shadow: -18px 0 42px rgba(0, 0, 0, 0.22);
  transform: translateX(105%);
  transition: transform 220ms ease;
}

.note-drawer.is-open {
  transform: translateX(0);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 19;
  background: rgba(10, 10, 10, 0.34);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.note-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.note-document {
  display: grid;
  gap: 10px;
}

.note-preview-shell {
  min-height: auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.note-flag-row,
.note-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.note-action {
  padding: 7px 10px;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.note-properties {
  display: grid;
  gap: 0;
}

.note-properties-editable,
.note-properties-locked {
  margin-top: 2px;
}

.note-property {
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.note-property-label {
  color: var(--muted);
  font-size: 12px;
}

.note-property-value {
  margin-top: 4px;
  line-height: 1.35;
  font-size: 14px;
}

.note-property-editor {
  display: grid;
  gap: 6px;
}

.note-property-input {
  width: 100%;
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  font: inherit;
}

.note-property-input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
}

.note-property-textarea {
  min-height: 92px;
  resize: vertical;
}

.note-property-locked .note-property-value-readonly {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
}

.overlay-panel {
  position: fixed;
  top: 84px;
  right: max(12px, calc((100vw - min(1660px, calc(100vw - 24px))) / 2));
  width: min(320px, calc(100vw - 24px));
  max-height: calc(100vh - 120px);
  overflow: auto;
  z-index: 30;
  padding: 12px 12px 14px;
  border-radius: 16px;
  background: #1c1c1c;
}

.overlay-panel.is-hidden {
  display: none;
}

.panel-group {
  display: grid;
  gap: 3px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.panel-field {
  display: grid;
  gap: 6px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
  color: var(--muted);
  font-size: 11px;
}

.saved-views,
.property-list,
.source-grid {
  display: grid;
  gap: 3px;
}

.saved-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px;
}

.saved-view.is-active .saved-view-main {
  background: rgba(255, 255, 255, 0.07);
}

.saved-view-main,
.property-row,
.panel-row-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  text-align: left;
  min-height: 32px;
  padding: 6px 9px;
  font-size: 12px;
}

.saved-view-main > span,
.property-row > span,
.panel-row-button > span {
  flex: 1;
}

.saved-view-copy,
.property-row-copy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.saved-view-copy > span:last-child,
.property-row-copy > span:last-child {
  min-width: 0;
}

.saved-view-state,
.property-row-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: var(--muted);
}

.saved-view-state {
  font-size: 11px;
}

.saved-view-delete {
  width: 32px;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.source-grid-inline {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panel-header-subview {
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr) 31px;
  align-items: center;
}

.panel-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: none;
}

.panel-title-strong {
  color: var(--muted-strong);
  text-align: center;
}

.panel-view-identity {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.panel-view-icon {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.01);
}

.panel-view-name {
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(38, 74, 104, 0.42);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.panel-view-name-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.panel-view-name-copy strong,
.panel-view-name-copy small {
  display: block;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel-view-name-copy strong {
  font-size: 13px;
  line-height: 1.2;
  font-weight: 500;
  color: var(--text);
}

.panel-view-name-copy small {
  font-size: 10px;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.46);
}

.panel-menu-list {
  gap: 2px;
}

.panel-row-button:hover,
.property-row:hover,
.saved-view-main:hover,
.saved-view-delete:hover,
.icon-button:hover,
.db-filter:hover,
.note-action:hover {
  background: var(--surface-hover);
}

.panel-row-label,
.panel-row-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.panel-row-label {
  flex: 1;
  color: var(--text);
  font-size: 12px;
  font-weight: 450;
}

.panel-row-meta {
  color: var(--muted);
  font-size: 12px;
}

.panel-row-label i,
.panel-row-meta i,
.note-property-label i,
.property-row i,
.saved-view-main i,
.panel-view-icon i {
  font-size: 14px;
  line-height: 1;
}

.panel-section-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
}

.panel-group-subview {
  gap: 8px;
}

.panel-subcopy {
  color: var(--muted);
  font-size: 11px;
}

.panel-inline-actions {
  display: flex;
  gap: 8px;
}

.panel-inline-button {
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted-strong);
  font-size: 11px;
}

.panel-inline-button:hover,
.db-toolbar-action:hover {
  background: var(--surface-hover);
}

.panel-option-list {
  display: grid;
  gap: 4px;
}

.panel-option-row {
  min-height: 46px;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
}

.panel-option-row:hover {
  background: var(--surface-hover);
}

.panel-option-row.is-selected {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
}

.panel-option-copy {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1;
}

.panel-option-copy > span:last-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.panel-option-copy strong {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
}

.panel-option-copy small {
  font-size: 11px;
  color: var(--muted);
}

.panel-option-state {
  color: var(--muted-strong);
  flex: 0 0 auto;
}

.property-row {
  align-items: center;
}

.property-row-copy {
  color: var(--text);
  font-size: 12px;
  font-weight: 450;
}

.property-row-state i {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
}

.toolbar-actions .icon-button,
.layout-toggle .icon-button {
  width: 31px;
  min-height: 31px;
}

.toolbar-actions .icon-button i,
.layout-toggle .icon-button i {
  font-size: 14px;
}

.empty-state,
.note-empty {
  padding: 10px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.empty-title,
.note-empty-title {
  font-size: 16px;
  line-height: 1.15;
  font-family: var(--font-display);
  letter-spacing: 0.02em;
}

.search-match {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #171717;
  border-radius: 14px;
}

.search-match-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
}

.search-match p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 14px;
  line-height: 1.5;
}

.search-match-row {
  margin-top: 10px;
  padding: 10px 12px;
}

.record-preview-frame,
.record-list-preview,
.record-row-preview {
  position: relative;
}

.record-collection-actions {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 3;
}

.record-collection-action {
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.62);
  padding: 0;
}

.record-collection-action i {
  display: inline-flex;
  width: 16px;
  height: 16px;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
}

.record-collection-action:hover {
  color: rgba(255, 255, 255, 0.96);
}

.record-collection-action.is-active:first-child {
  color: #ff9700;
}

.record-collection-action.is-active:last-of-type {
  color: #0099ce;
}

.collection-popover {
  position: absolute;
  right: 0;
  bottom: 36px;
  width: 220px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(14, 16, 20, 0.98);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  padding: 10px;
}

.collection-popover-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 12px;
}

.collection-popover-create {
  color: rgba(255, 255, 255, 0.72);
}

.collection-popover-list {
  display: grid;
  gap: 4px;
}

.collection-popover-node {
  display: grid;
  gap: 3px;
}

.collection-popover-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.collection-popover-done {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.76);
}

.collection-popover-done i {
  display: inline-flex;
  width: 16px;
  height: 16px;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
}

.collection-popover-done:hover {
  color: rgba(255, 255, 255, 0.98);
}

.collection-popover-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  font-size: 13px;
  padding-left: calc(var(--collection-popover-depth, 0) * 16px);
}

.collection-popover-label {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.collection-popover-label span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-popover-empty {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.52);
  padding: 6px 2px;
}

.collection-settings-popover {
  margin: 6px 0 0 calc(30px + (var(--collection-depth, 0) * 18px));
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(20, 21, 24, 0.98);
  display: grid;
  gap: 10px;
}

.collection-settings-field {
  display: grid;
  gap: 6px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.62);
}

.collection-settings-input,
.collection-settings-select {
  width: 100%;
  min-height: 30px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
}

.collection-settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.collection-settings-button {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
}

.collection-settings-button.is-primary {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

@media (max-width: 1180px) {
  .db-toolbar-primary {
    grid-template-columns: 1fr;
  }

  .note-atom-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .collections-sidebar {
    position: static;
  }
}

@media (max-width: 820px) {
  .app-shell {
    width: calc(100vw - 16px);
  }

  .note-atom-columns {
    grid-template-columns: 1fr;
  }

  .records-grid-cards {
    grid-template-columns: 1fr;
  }

  .record-list-row,
  .record-row {
    grid-template-columns: 1fr;
  }

  .row-divider {
    display: none;
  }

  .record-row-preview,
  .record-list-preview {
    min-height: 220px;
    width: 100%;
    height: auto;
  }

  .media-modal {
    width: calc(100vw - 28px);
    max-width: calc(100vw - 28px);
  }
}
