.detail-panel {
  position: sticky;
  top: 14px;
  align-self: start;
  max-height: calc(100vh - 84px);
  overflow: auto;
  background: #141414;
  border-left: 1px solid var(--line-strong);
}

.detail-header {
  position: sticky;
  z-index: 2;
  top: 0;
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: #141414;
  border-bottom: 1px solid var(--line);
}

.detail-heading {
  min-width: 0;
}

.detail-title {
  overflow: hidden;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-state {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.close-detail {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  background: transparent;
  border-radius: 5px;
  color: var(--muted);
  font-size: 21px;
  line-height: 1;
}

.close-detail:hover {
  background: var(--surface-3);
  color: var(--text);
}

.detail-preview {
  padding: 14px 16px 0;
}

.detail-image {
  display: block;
  width: 100%;
  max-height: 320px;
  aspect-ratio: 16 / 11;
  object-fit: contain;
  background: #090909;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.detail-preview-actions {
  display: flex;
  justify-content: flex-end;
  padding: 8px 16px 2px;
}

.detail-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
  padding: 11px 16px 13px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.detail-path {
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--faint);
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.detail-form {
  display: grid;
  gap: 13px;
  padding: 14px 16px 0;
}

.detail-section-title {
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-weight: 650;
}

.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 122px;
  gap: 10px;
}

.field-hint {
  color: var(--faint);
  font-size: 12px;
  font-weight: 400;
}

.duplicate-note {
  padding: 8px 10px;
  background: #21171a;
  border-left: 2px solid var(--danger);
  color: #f0a0b7;
}

.detail-actions {
  position: sticky;
  bottom: 0;
  align-items: center;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 3px -16px 0;
  padding: 11px 16px;
  background: #141414;
  border-top: 1px solid var(--line);
}

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

.save-status.is-error {
  color: var(--danger);
}

.detail-action-buttons {
  display: flex;
  gap: 8px;
}

.download-button {
  align-items: center;
  display: inline-flex;
  text-decoration: none;
}
